A web page has content, navigation and other non-content items such as menus and headings. How does one add a print function to all pages on a Drupal web site so that the user can print a page easily without all of the clutter?
Asked
Active
Viewed 316 times
-1
-
Should be on Superuser rather than Serverfault? – Coops Nov 10 '09 at 12:02
-
I'm thinking more webmasters than superuser, this is the exact type of question for that exchange. – Doug Feb 17 '12 at 22:53
2 Answers
1
Use a print-stylesheet, setting i.e. the navigation, ad and commentsection to display=none. Embed the stylesheet in your head-section of your page.tpl like this
<link rel="stylesheet" type="text/css" href="/css/print.css" media="print" />
and you are done. Now everytime a printer is called, the webbrowser will use this stylesheet instead of the normal one.

Malte Diedrich
- 36
- 2
-
Print stylesheets are the way to go. Having to open another page to get to the "print version" of a web page is annoying, redundant and unnecessary. And, of course, this concept applies to web pages outside of Drupal as well. – Garrett Albright Nov 10 '09 at 18:43