Page 1 of 1

How do I make a Print Version page ?

Posted: Fri Nov 14, 2008 1:15 am
by jty
I would like a print version page ie no header, no footer, no layout
I want the category page on plain white paper without header, footer, layout
How do I get the category page without the attached layout.tpl please?
It is for a price list
Thank-you

Re: How do I make a Print Version page ?

Posted: Fri Nov 14, 2008 2:10 am
by bthirsk
Here's a little article that might help.
http://www.devarticles.com/c/a/PHP/Use- ... f-Files/1/

Re: How do I make a Print Version page ?

Posted: Fri Nov 14, 2008 2:40 am
by hm2k
You don't really need any of that, it can all be done using CSS...

http://www.alistapart.com/articles/goingtoprint/

Once you made your print.css, the only change you need in your layout.tpl is you need to add this line into the heading:

Code: Select all

<link rel="stylesheet" type="text/css" media="print" href="print.css">
If you manage to make a decent print.css, I may include this into the core.

Note: you can use "display:none" in the PHP to prevent areas you don't want from showing, such as header/footer/sidebar etc.

Re: How do I make a Print Version page ?

Posted: Fri Nov 14, 2008 11:39 am
by jty
I'm missing something here.
I understand that I need to do a print.css and link to it in the layout.tpl
But what I don't understand is how do I tell open cart when to use the default.css and when to use the print.css. Otherwise, Open Cart will hide my eg menu on "normal" category pages.

Do I have to make a copy of layout.tpl and use that for my price list so it doesn't muck up my normal layout.tpl ?

Re: How do I make a Print Version page ?

Posted: Fri Nov 14, 2008 1:25 pm
by Qphoria
That is handled by that line hm2k gave:

Code: Select all

<link rel="stylesheet" type="text/css" media="print" href="print.css">
Browsers know that when you click "print" on a webpage, that it needs to load that file when printing

Re: How do I make a Print Version page ?

Posted: Fri Nov 14, 2008 1:48 pm
by jty
OIC. I was missing this bit of knowledge
Qphoria wrote: Browsers know that when you click "print" on a webpage, that it needs to load that file when printing
Thank-you all

Re: How do I make a Print Version page ?

Posted: Fri Nov 14, 2008 11:30 pm
by hm2k
See where it says

Code: Select all

media="print"
as opposed to the normal

Code: Select all

media="screen"