Add Print Stylesheet Plugin for Joomla 1.5, 2.5 and 3.x

Please rate on JED if you find this extension useful.

What

This plug-in with separate versions for Joomla 1.5, 2.5 and 3.x loads a print stylesheet in the [template path]/css folder.

You could have a different print stylesheet for each installed template if you want, but use the same file name e.g. print.css.

Why

A print stylesheet can be useful to remove unwanted elements from printed copies of your web pages. This might include dark ink wasting backgrounds, menus and other elements that have no use in a printed copy. Many templates do not include a print stylesheet by default. It is fairly easy to edit the index.php file and insert appropriate code to add a print stylesheet but changes in the index.php can be overwritten by template updates.

Installation

  • Install the plug-in using the standard Joomla installer.
  • Upload the print stylesheet to the [template path]/css folder.
  • In Plug-in Manager, edit "System - Add Print Stylesheet", add the stylesheet file name and enable the plugin.
  • Refresh the page on your website and you should now see the appropriate line in the page source.

Example Print Stylesheet

The following code is an example of the contents of a print stylesheet where (in this case) the background colour is adjusted and the menu and footer are not displayed in the print version of the website. Your print stylesheet will likely look different and you can use the Developer Tools in your browser or a similar tool to help find which CSS elements you want to remove or adjust in the printed version of your website.

/**
 * Print Stylesheet
*/

/* Lighten Background Color */
body {background-color: #ffffff;}

/* Hide Navigation */
#rt-header {visibility: hidden;}

/* Hide Footer */
#rt-footer {display: none;}

Upgrade

  • A newer version of the plug-in can be installed over the top of an older version.

Downloads

Joomla 3.x compatible plg-j3.x-addprintstylesheet-v1.3.zip

Change History

v1.3
Fix "Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP" warning message

v1.2
Add support for Joomla Extension Manager updates

v1.1
Add JURI::base() to more accurately determine template path
Add Support for Joomla 3.x
     
v1.0
Initial Release

 

Tip Sheets

Tips Sheet Number 1: Creating a Web Site