Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 298906

Include theme print stylesheets in Book printer friendly export

$
0
0

Problem/Motivation

Book module renders export pages with custom page template that should contain "print.css" but this broken because asset hardcoded relatively to current page.
Also there's no way to alter assets attached to the page because response is returned from controller without processing assets (to prevent unneeded styling)

Steps to reproduce:
1) enable book module and create new book node
2) visit "Printer-friendly version" like /book/export/html/1
3) make sure print.css loaded

currently it's broken because path should be core/misc/print.css
print-css

Proposed resolution

Make new library core/drupal.print with print.css
Allow theme libraries to override/extend drupal.print library
Add tests and commit

Remaining tasks

find a way to render attached libraries in custom responses that should skip page template from active theme

User interface changes

libraries attached in book export pages should be rendered

API changes

no

Original report by [@pianomansam]

The book module should really have the capability to pull in the print stylesheets from the active theme. Right now it is hardcoded in book-export-html.tpl.php to only pull in misc/print.css and getting it to do more requires copying the template file into the theme directory and manually pulling in a print stylesheet. This is very hackish and uncharacteristic of the Drupal Way.


Viewing all articles
Browse latest Browse all 298906

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>