howto make changes to print template..?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
numer9

howto make changes to print template..?

Post 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!
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: howto make changes to print template..?

Post 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)
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
numer9

Re: howto make changes to print template..?

Post 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
Locked

Return to “CMSMS Core”