One of the most forgotten or ignored "features" of a website is the print page. Many times a print page is not even considered to be part of building a web-site and in that case it is up to the designer or front-end developers mood to create printer friendly pages or not
Not is probably the most common answer because it takes time and it's simply not part of the scope of the project while in realty it should be.
First of all I want to point out that I try to avoid using a print icon or something like that in the template, printing is a browser functionality and not a feature in a website.
The start of your print page design adventure is adding a print css file to your Joomla! template css directory which you can simply call "print.css".
To hook up that file with your template you'll need to open your template "index.php" file and find the following line:
<jdoc:include type="head" />
That piece of code is what renders Joomla! meta data and javascript and css files. Below that line you need to add the following html:
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/print.css" type="text/css" media="Print" />
Now once that file is created and the line is added to the head section of your template you can start crafting your print page css.
Things like; read more links, last 5 forum posts, large header images, ads or other clickable items are not really useful when you are reading the content on a piece of paper. That's why we are going to hide everything that doesn't need to be printed.
You can do two things, look for what you want to hide in your template file or just do a view source in your browser. I usually start with the template file to hide the large chunks and after that I start looking in the source for things like; read more links which are rendered by the CMS itself.
In the css file you just start adding classes and id's to a list that is set to display none. Make sure you leave your content container untouched to keep it visible.
#nav-container,
#promo-container,
#middle-sidebar,
#right-sidebar,
#more-container,
p.read-more,
div.items-pagination,
div.items-links,
div.after-content-events {
display: none;
}
You can test what is happening in your browser by using the print preview function.
When you are at the point where you only have the content left that you would like to show on print you can start adding some css to the print.css file to make it look a little more beautiful, there are limits but you can add some eye candy.
Now, one of the reasons why you should create print pages is my dad. He is one of those old school guys that prints pages from the internet to read instead of reading on screen and there are probably more oldies like him that do the same :-)
# 2 - Posted by: Karen Lehrer on 2009-06-10 13:48:31
I have made a print.css for a Joomla 1.5 site that works if you print the page using either a keyboard short cut or by "file/print" from the browser. The print.css is not taken into account however if I print using the print icon in the page. How would I be able to bridge the use of the print icon so that the css is taken into account?
# 3 - Posted by: Arpit on 2009-06-20 06:15:00
Hi,
Can we make it reverse..?
My print content is too small.
Can i go like this:
choose those id's to print out only.
Reverse from choosing id's to leave the content.
Thanks,
Arpit
# 4 - Posted by: 11x17 printer review on 2009-12-07 13:59:28
Thanks for sharing. I've been looking for this so long.
Help for creating beautiful comments.
Please read this help text and use it when you post a comment.
You can use the following html in your comment:This is the first paragraph of your comment
This is the second paragraph of your comment and this text will be bold.
This is the third paragraph of your comment and this text will be italic.
Thanks
In Joomla! land there are a couple of ways to built your website and I'm talking about the template specifically. Now...
One of the most forgotten or ignored "features" of a website is the print page. Many times...
The Joomla Project is pleased to announce the immediate availability of Joomla 1.5.7 [Wovusani]. This...
As you may know already there is an option in Joomla! 1.5 to create one menu tree but show different...
For professional Joomla! consultancy and development visit Alvaana.com
Copyright 2008 The Woof and The Warp - Arno Zijlstra
Re: It works after all!
# 1 - Posted by: AnotherGuy on 2008-09-11 03:04:31
I just did this on my site after reading this little tut and it works great. I had completely forgotten that the print view in Joomla! isn't very pretty by default, so thanks a lot for the reminder!
I'm still tweaking it a bit, but it works now and that matters more than anything.