Drupal - Override print.css in Theme

Q: How can I override the default print.css with a .css file in my theme folder? I put print.css into my theme folder but it's not being used.

A: To use your own print.css file you have to configure the 'Printer, e-mail and PDF versions' module to specify which .css file that it should use.

The rather long-winded Printer, e-mail and PDF versions module places a printer friendly button on your pages and allows you to render your content in a printer friendly way using an alternative php template and .css file. To change the template you can simply copy the print.tpl.php file from /sites/all/modules/print/ directory and copy it to you theme folder - and edit as required.

You might think that you can do the same with the print.css file, but you can't, if you copy it to your theme folder the module will not automaticallY pick up on it, instead it will continue to use the original print.css file

You need to specify the path to your alternative .css file in the module's settings. Go to the 'Printer, e-mail and PDF versions' settings page (admin/settings/print) and click on the 'Settings' tab.

Then provide the path to your .css file in the 'Stylesheet URL:' textbox, for example if you want to specify dashboard_print.css in your theme folder you insert:

%b/%t/dashboard_print.css

Once you save the settings drupal should now use your css file for printer friendly versions of content....

Joined: 21/05/2009
User offline. Last seen 18 weeks 3 days ago.
Everything would be much

Everything would be much easier if the css. file was compatible with the module, isn't there any way available now to make it compatible. I like to believe that everything is possible in web design and it is but some circumstances things get more complicated and can only be solved with consistent help from an expert. Thanks for clearing things out, I hope that's all the information I need to add the print myself.

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can use BBCode tags in the text.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.

Proud member of the:
Irish Internet Association

phone-number.png