Printer Friendly format
| From: | Eric C. Pollitt | Date: | Tue, 10 Sep 2002 22:05:10 +0000 |
| Subject: | Printer Friendly format | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5957@lists.php.net to get a copy of this message | ||
How can I implement a "Printer Friendly" format (template) using Smarty?
My pages have the following format:
<?php require '/home/globalhemp/www/Smarty/Smarty.class.php'; require
'/home/globalhemp/www/Poll/booth.php';
$smarty = new Smarty;
$smarty->compile_check = true;
$smarty->debugging = false;
$smarty->assign("TITLE", "Title information here");
$smarty->assign("DESCRIPTION", "Short description here");
$smarty->assign("KEYWORDS", "some, keywords, here");
$smarty->assign("AUTHOR", "Author, Arthur, Awefur");
$smarty->assign("CONTENT", '
<P CLASS="size2">Lots of HTML content goes here.</P>
');
$smarty->display('/home/globalhemp/www/Smarty/templates/index.tpl');
?>
Example Web page using Smarty:
http://globalhemp.phpwebhosting.com/News/2002/August/transylvanian_trousseau
.html
NOTE: Current "Print this page" is a slow script that I would like to
replace with something that I'm positive Smarty can do MUCH better.
Basically, what I want to do is to use an alternative template for
$smarty->display.
I would also require that the "Print Friendly" page includes all content
within $smarty->assign("CONTENT", ""); most importantly images. Too many
"Print Friendly" scripts out there assume that all files are in the same
directory as the script and don't properly write paths to the appropriate
images, etc. The script that I'm using now does this correctly, but uses
Python.
Thanks,
Eric C. Pollitt, Founder
401 E. Illinois Ave.
Peoria, IL 61603
Global Hemp - Portal to the hemp community
http://www.globalhemp.com/
Those who don't like thinking should at least rearrange their prejudices
from time to time.
-- Luther Burbank, 1849-1926