Page 1 of 1

howto make changes to print template..?

Posted: Mon Mar 26, 2007 8:47 am
by numer9
hey,
i want to add custom page-header to print template. Right now the "print" link just creates the blank page, inserting just content. I want to add some custom page-header and page-footer for printout. I found "print code" - in function.print.php and CMS's content.functions.php, but that's not exactly "easy" way. Is there an easy way to change that template, and add some html block just to printing site?

thanks!

Re: howto make changes to print template..?

Posted: Mon Mar 26, 2007 11:21 am
by kermit
easiest is to use print media stylesheet and skip the {print} tag.

if you want to use {print} anyway, two lines need to be changed in ./lib/content.functions.php:

lines 402 & 418 (lines start with: $tpl_source = ) right after the tag (and before {content}) is where the "print header" would go. i would suggest inserting a call to a global content block {global_content name="printheader"} and stick your "print header" in the gcb instead of trying to get fancy with markup in the php code.

(note: line numbers referenced are correct for cmsms v1.04)

Re: howto make changes to print template..?

Posted: Mon Mar 26, 2007 11:13 pm
by numer9
thanks,
that's exatcly how i did (created global content blocks for footer and header of the print template and inserted them into template in lib/content.functions.php) :D

i didn't want to use css for this, since it's a whole new graphic file for the print header and i didn't want to load this (and with css set visible to none) every time the "normal" page comes up...

so - thanks for the advice, now i'm sure i did the right thing! :D