Does anyone know how to set up dtml docs or methods to headers and footers form a document. example: http://zopeserver:8080/OPS/content/testNewsItem9/testNewsItem9?pp=1 I have the code but can't figure out how to set it up I found javascript that will print the page (http://www.hypergurl.com/printpage.html) but that didn't meet needs. adding "?pp=1" to the end of a URL doesn't give results like I see on http://www.zope.org/Members/NIP/ZMailIn/CMFMailIn_available?pp=1 Any help greatly appreciated Eric Dunn
On Thu, Jun 20, 2002 at 11:54:07AM -0400, eric.n.dunn@bankofamerica.com wrote:
Does anyone know how to set up dtml docs or methods to headers and footers form a document. example: http://zopeserver:8080/OPS/content/testNewsItem9/testNewsItem9?pp=1
Untested (and someone else may contribute the ZPT version), but I'd think if you put a bit of logic in your standard_html_header and footer, it'll work fine. The footer might not even need to be modified, depending on your layout. Something similar to: standard_html_header ==================== <dtml-if "pp==1"> <!-- Here's the html header stuff for a printable page --> <body bgcolor="#ffffff" text="#000000"> <dtml-else> <!-- Here's the html header stuff for a non-printable page --> <body bgcolor="#000000" text="#ff0000" background="/someillegiblewatermark.jpg"> </dtml-if> -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
On Thu, Jun 20, 2002 at 01:41:51PM -0500, Mike Renfro wrote:
Untested (and someone else may contribute the ZPT version), but I'd think if you put a bit of logic in your standard_html_header and footer, it'll work fine. The footer might not even need to be modified, depending on your layout. Something similar to:
standard_html_header ====================
<dtml-if "pp==1"> <!-- Here's the html header stuff for a printable page --> <body bgcolor="#ffffff" text="#000000"> <dtml-else> <!-- Here's the html header stuff for a non-printable page --> <body bgcolor="#000000" text="#ff0000" background="/someillegiblewatermark.jpg"> </dtml-if>
Please keep your replies on list, since I'm not the ultimate authority, and have occasionally even been completely wrong in the past. You're getting an error because my untested code didn't entirely work. It doesn't take into account what happens if the pp variable isn't defined at all. The original version of this is at http://www.zope.org/standard_html_header/view_source , but if you use <dtml-if pp> instead of what I used before, you should be ok. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
Aloha, I use a combo of different stylesheet (via zope URL/acquisition 'magic') and ZPT logic to do printable pages. I have a printable page stylesheet in a folder 'printerpages'; to publish with printable styles for http://myserver.net/coolfolder/coolpage I simply add the folder to the URL: http://myserver.net/coolfolder/printerpages/coolpage and the printable stylesheet is found first and applied... (learned this in the zope book or basic howtos somewhere...) I use some simple ZPT conditional logic in my 'master' page templates to omit/alter background graphics, navigation menu(s), use grayscale instead of color logo, etc. based on publishing context ('printerpages' or not). John S. __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com
participants (3)
-
eric.n.dunn@bankofamerica.com -
John Schinnerer -
Mike Renfro