I was wondering if anyne had thought of making a stylesheet for the print page. I cannot for example use the standard CSS sheet because I set the background image in CSS so it does not get stripped out.
My thoughts were check if a stylesheet 'print' exists. If you want to keep a name version, if the style sheet for a particular article is MAIN then perhaps MAIN-PRINT would be the print one.
Having a seperate method for printing vs display appears to have benefits, namely you can control page breaks in the print version or perhaps reorder some items, that you would not do for live rendering.
printer plugin stylesheet
print CSS
it shouldnt be that difficult, I have seen the section of code that generates the basic print template (which could also exist in the DB, instead of just CSS use a whole template if it exists, defaulting to the simple one if it doesnt).
This would let people control the look and feel of the printed output more easily. I just wanted to see if anyone was currently looking into that and if so had they encountered any problems with doing it. Or if they had thought about it, and had some ideas about why it should be done one way over another.
The data base is hit regardless, becuase it looks up the style sheet for the document, iut just uses the hardcoded template rather than one from a DB so there is very little extra cost to making it more dynamic, but I think a big payoff.
This would let people control the look and feel of the printed output more easily. I just wanted to see if anyone was currently looking into that and if so had they encountered any problems with doing it. Or if they had thought about it, and had some ideas about why it should be done one way over another.
The data base is hit regardless, becuase it looks up the style sheet for the document, iut just uses the hardcoded template rather than one from a DB so there is very little extra cost to making it more dynamic, but I think a big payoff.
Re: printer plugin stylesheet
try to see my changes on the lib/content.functions.php.....
as you can see, i created "another" class for the print function. hope this helps, somehow.
Code: Select all
else if (isset($_GET["print"]))
{
$script = '';
if (isset($_GET["js"]) and $_GET["js"] == 1)
$script = '<__script__ language="JavaScript">window.print();</__script>';
if (isset($_GET["goback"]) and $_GET["goback"] == 0)
{
$tpl_source = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'."\n".'<__html><head><title>{title}</title><meta name="robots" content="noindex"></meta>{metadata}{stylesheet}{literal}<style type="text/css" media="print">#back {display: none;}</style>{/literal}</head></__body style="background-color: white; color: black; background-image: none;"><h1>{title}</h1><br /><span class="printcontent">{content}</span><br /><br /><span class="printfooter">(C) 2006 Supply Chain Consulting. All Rights Reserved.</span>'.$script.'<__body></__html>';
}
else
{
$tpl_source = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'."\n".'<__html><head><title>{title}</title><meta name="robots" content="noindex"></meta>{metadata}{stylesheet}{literal}<style type="text/css" media="print">#back {display: none;}</style>{/literal}</head></__body style="background-color: white; color: black; background-image: none;"><form action="index.php?page='.$tpl_name.'" method="post"><input type="submit" value="Go Back"></form><h1>{title}</h1><br /><span class="printcontent">{content}</span><br /><br /><span class="printfooter">(C) 2006 Supply Chain Consulting. All Rights Reserved.</span>'.$script.'<__body></__html>';
}
return true;