Recent Topics

Printer Friendly Skin

Started by on Feb 11, 2019 – Contents updated: Feb 17, 2019

Feb 11, 2019 07:37    

Not sure if this is of any use to other people, but a few years ago I made a skin that would just show a post content, well just the page that shows, so [pagebreaks] would have to be lacking.

You can go to my site and click on a post or page and you will see a Printer Friendly Page link.

I don't print much but it has been useful, and I have just ensured it's working on v6.10.6

It's in two parts.
a) the skin folder and
b) code in the [/skins/your_skin/_single.main.php] and [/skins/your_skin/_page.main.php] for example.

Here's the code for the pages which I put in the metatag section right after the post. You may have fiddle to get it how you want it. Below it has been inserted before an edit link I already had at the bottom of each post.

echo'<a href="https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'?tempskin=print&amp;disp='.$disp.'" target="_blank"><img class="print_icon" src="../../rsc/icons/print_icon.png" alt="print" title="print" /> &nbsp; Printer Friendly Layout &nbsp;</a> &nbsp;&nbsp;';

$Item->edit_link( array( // Link to backoffice for editing
'before' => '',
'after' => '',
'text' => '#',
'title' => '#',
'class' => 'edit',
'save_context' => true,
) );

Have attached the skin which has two css files that will want to look at.

May be of some use to someone


Feb 11, 2019 14:13

You can also make a printer version of your CSS which will automatically apply (and hide unwanted items) when printing.

Feb 11, 2019 14:43

Yes I think I'll try that for the exercise too then.
Thanks for the reminder that i could {display:none}, somehow my method grabbed my interest, probably as I learnt a little about skins

Form is loading...

CMS + user community – This forum is powered by b2evolution CMS, a complete engine for your website.