How to create a print.css?

pszilard

Thanks for the positive feedback! I appreciate it, especially from an experienced Bakers :D. I'll need to find how to not print the Read More, as I don't think that they are a page "element" which I could then switch off. Any hints here would be welcome.

Re the Shop - it is still on the To Do list, however the shop module looked too time consuming to set up and offered little over the "news" format, especially as it doesn't allow some key features, which I can do using ShopFactory Pro (my example here), which is my intention for the future. For instance:

  • Loading contents from a spreadsheet interface
  • easy control over sort order
  • any item can appear in more than one category
I have a commercial license for ShopFactory, which is a few years old and down level, but it will do what I need. I intend to either run in a Wrapper module in WB or just have it on another link. Just haven't got enough time to develop it at the moment.

Having said that, if I could use a good WB based option, I would be very interested in that too.

Thanks again for the print solution! Cheers guys.
Paul Szilard
WB user since Dec 2007:
[url="http://www.remektek.com.au/wb"]http://www.remektek.com.au/wb[/url]
[url="http://photos.remektek.com.au/"]http://photos.remektek.com.au/[/url] for my photo portfolio

StefanRSA

Realy nice site Pszilard.

Its always a good thing to also not display your "Read More" links on the print page.... Unless you need it to display...

Glad I could Help!

Tell me, why dont you use the bakery or GoCart modules for your shop?
How can the sky be the limit? There is much more behind the sky!!!

pszilard

Quote from: StefanRSA on September 01, 2008, 09:30:33 AM
Its actually easy thing to do but a nightmare if you just don't know what to do....
Had the same problem and the slution found was as follow:

Create a print.css file and specify what should be displayd (To print) and what should not:
#news { display: none; }
#content {  font: Verdana, Arial, Helvetica, sans-serif; color: black; }
#footer {  display: none; }


Then in your template's index.php ad:
<link href="<?php echo TEMPLATE_DIR; ?>/print.css" rel="stylesheet" type="text/css" media="print" />

And also place the following where you want the print button to apear in your index.php :
<a href="javascript:window.print()" title="print page">
     <img src="<?php echo TEMPLATE_DIR; ?>/print.gif"  border="0" width="120" height="42" alt="Print This Page" />


Thats it.... Try it...

Thanks. I got it working! I removed the size definition of the print icon, and created a print icon to use. I also had to look in the screen.css to identify the parts on screen to not print and it all works. See my page at www.remektek.com.au

Thanks again.
Paul Szilard
WB user since Dec 2007:
[url="http://www.remektek.com.au/wb"]http://www.remektek.com.au/wb[/url]
[url="http://photos.remektek.com.au/"]http://photos.remektek.com.au/[/url] for my photo portfolio

pszilard

Quote from: chio on September 01, 2008, 08:42:30 AM

/*-------------------------PRINT-----------------------------*/
 
@media print {

.nopr, #leftbox, #topmenu, #footerbox, #gecko_scrollbar {display:none;}
#mainbox {width:80%; margin-left:15%}

}



I've added your bit of code to the end of the .css and refreshed the template, however it had no effect whatever! Not sure why.
Paul Szilard
WB user since Dec 2007:
[url="http://www.remektek.com.au/wb"]http://www.remektek.com.au/wb[/url]
[url="http://photos.remektek.com.au/"]http://photos.remektek.com.au/[/url] for my photo portfolio

StefanRSA

Its actually easy thing to do but a nightmare if you just don't know what to do....
Had the same problem and the slution found was as follow:

Create a print.css file and specify what should be displayd (To print) and what should not:
#news { display: none; }
#content {  font: Verdana, Arial, Helvetica, sans-serif; color: black; }
#footer {  display: none; }


Then in your template's index.php ad:
<link href="<?php echo TEMPLATE_DIR; ?>/print.css" rel="stylesheet" type="text/css" media="print" />

And also place the following where you want the print button to apear in your index.php :
<a href="javascript:window.print()" title="print page">
     <img src="<?php echo TEMPLATE_DIR; ?>/print.gif"  border="0" width="120" height="42" alt="Print This Page" />


Thats it.... Try it...
How can the sky be the limit? There is much more behind the sky!!!

chio

You are talking about different things

I usually have some small extra code at the end of the "normal" css (which has no "media" attribute.
This little code is for printing only and hides some blocks when printing (See Print preview on your browser)

/*-------------------------PRINT-----------------------------*/
 
@media print {

.nopr, #leftbox, #topmenu, #footerbox, #gecko_scrollbar {display:none;}
#mainbox {width:80%; margin-left:15%}

}


Another thing is to have a different template for printing - this hasn't to do with print.css, it is a normal (screen)css, which is specially made for printing.

The best way is to have a parameter (like index.php?style=print) to switch between the templates. Or change the css with javascript.

pszilard

I am using the andreas08 template on my site, but this question really applies to all as a general question.

I would like to add a "Print" link, which would print the page contents, without the menus and banners, etc. I think the answer is to use a print.css, but I need help please;

1) How do I create (or modify) a print.css
2) Does print.css need to be template specific, or can I use a "general" one
3) Once added to the template, how do I actually use it? I.e. how to create a link that will call it?
4) I would like to use similar functionality as GMAIL's "PRINT", which opens a new tab of just the page contents without the banners, and menus or side bars.

Thanks in advance...
Paul Szilard
WB user since Dec 2007:
[url="http://www.remektek.com.au/wb"]http://www.remektek.com.au/wb[/url]
[url="http://photos.remektek.com.au/"]http://photos.remektek.com.au/[/url] for my photo portfolio