I love Drupal's Printer, email and PDF versions module, which allows you to add links to any of your content types to provide that content in a print-friendly fashion or in a PDF or simply to send to a friend via email.
You can configure
- Which of those links to include (above I include only printer-friendly and email links)
- Whether to display the links as icons only, text only, or both (I have both above)
- Which content types should automatically include those links
- Where to display them (above the post, below the post, etc)
So far, so good. The only problem is when you want to include these icons on a view or otherwise-generated page! The UI allows for you to place these links on specific content types when you're editing that content-type looks like this (on the content type's edit screen):
No such options exist when you're creating a page via a View. When I got a request to place a 'Printer-friendly' link on a view recently, I started thinking about how to do that. If I didn't have a printer-friendly way of displaying the screen, the print screen included a lot of extra information (blocks, etc), which were not necessary in the printed versions of the page. So I explored what the URL behind the 'Printer-friendly' link actually was, and it turns out, it's nothing more than:
So, to mimic that, I added a Header (Global: text) box to my view and placed in the following (text format = 'PHP code' for this):
<?php $current_url = getenv('REQUEST_URI'); ?> <img src='/sites/all/modules/contrib/print/icons/print_icon.gif'> <a href='/print<?php print $current_url; ?> '>Printer-friendly version</a>
As you can see, what the above does is get the current URL (my view includes filters, so the URL is dynamic: folks may be looking at different lists, based on their chosen filters), then grabs the icon from the actual print module (modify this to fit the location of the module in your own installation), and builds the link. It works wonderfully! Prepares a printer-friendly version sans footers, headers, blocks, and respects the chosen filters of the view, since they are part of the URL that is generated. Let us know if you try this!