Post by jty » Fri Nov 14, 2008 1:15 am

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

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by bthirsk » Fri Nov 14, 2008 2:10 am

Here's a little article that might help.
http://www.devarticles.com/c/a/PHP/Use- ... f-Files/1/

Brent


Active Member

Posts

Joined
Wed Sep 03, 2008 11:33 am
Location - Canada

Post by hm2k » Fri Nov 14, 2008 2:40 am

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.
Last edited by hm2k on Fri Nov 14, 2008 2:58 am, edited 1 time in total.

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by jty » Fri Nov 14, 2008 11:39 am

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 ?

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Qphoria » Fri Nov 14, 2008 1:25 pm

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

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Fri Nov 14, 2008 1:48 pm

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

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by hm2k » Fri Nov 14, 2008 11:30 pm

See where it says

Code: Select all

media="print"
as opposed to the normal

Code: Select all

media="screen"

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK
Who is online

Users browsing this forum: No registered users and 26 guests