1 fireworkszone Jul 03, 2006 13:56
3 fireworkszone Jul 03, 2006 16:57
Sorry, but I would like to stick to this approach B)
4 fireworkszone Jul 04, 2006 07:38
I would like to stick to Yabba's approach and not to the CSS approach. Can anybody tell me what I am doing wrong.
:-/
5 yabba Jul 06, 2006 11:08
In your print skin you have an include for the bloglist, if you delete that line it'll get rid of your error (or copy the file to your print skin directory if you wan't the bloglist on your print skin).
¥
6 fireworkszone Jul 06, 2006 12:58
The 'Printer friendly' button is now working (not quite perfectly):
I created a new skin named print containing 3 files :
. _main.php,
. bloglist.php
. feedback.php
. print.css
Note: the _main.php is coming from the basic skin. I added the print.css to the file
<link rel="stylesheet" href="print.css" type="text/css" media="print"/>
I inserted the code and the link inside my _main.php file
Now, when I click the printer friendly link, I've got this:
http://www.fireworkszone.com/news/index.php?blog=3&paged=1&page=1&disp=posts&tempskin=print
As you can see in the new page I've got 5 posts with a style which is not coming from print.css.
From the page source I can see that _main.php (from basic) is included inside the _main.php from custom skin. There is something wrong about this.
What I would like is 'printer friendly' per post ID. You get only one post as in the Permanent link and you apply the print.css. How can I do that ?
Thanks
7 yabba Jul 08, 2006 09:46
There shouldn't be any of the custom.php in the print skin (the "exit;" stops it from being processed any further)
Remove this line from your print skin :-
<link rel="stylesheet" href="custom.css" type="text/css" />
and change the next line so it looks like this :-
<link rel="stylesheet" href="rsc/print.css" type="text/css" />
In your post loop, add the following code to generate a printer friendly link per post :-
echo '<a href="'.$Item->gen_permalink( 'pid', '', true ).'" title="printer friendly version">Printer friendly version</a>';
¥
8 fireworkszone Jul 11, 2006 09:21
Finally, I came up with this code for a printer friendly button that works. Add this code at the top of your _main.php skin
<?php
param( 'tempskin', 'string' );
if( $tempskin == 'print' ){
require_once dirname(__FILE__).'/print/_main.php';
exit;
}
?>
And the printer friendly link:
<a href="<?php
echo url_add_param( $Item->gen_permalink(), 'printme=1&skin=print', '1'); ?>" title="Printer friendly |<?php $Item->title(); ?>">Print</a>
The last printer friendly link you gave was not working:
echo '<a href="'.$Item->gen_permalink( 'pid', '', true ).'" title="printer friendly version">Printer friendly version</a>';
Thanks anyway for your help
B)
9 yabba Jul 11, 2006 10:30
Glad you got it working ;)
¥
Another approach :
using a print.css
Put this in your _main.php file :
and something like this in your print.css file
Every div that is not needed for the article, you put on display:none;