I created a "Printable Page" that is very simple if you use a "main content" object that is referenced in your root index_html. This does not require if-thens or any logic. This requires some background info to illustrate Zope's beauty... None of my folders have index_html (in an average public site). That exists once at the root. Everything inherits from this one file. However, every folder has a "body" method. <kinda like BODY in HTML> "body" is the local content template for that folder. example: index_html /* this looks like your standard page layout with navigation on the left */ <dtml-var standard_html_header> <table> <tr> <td><dtml-var navbar></td> /* navbar can include smart trees, BTW-there is only one navbar, too */ <td><dtml-var body></td> /* body exists as its own object, now */ </tr> </table> <dtml-var standard_html-footer> So my tag is as simple as ... <a href="printThis">... /* this can be anywhere, because you are inheriting the current namespace */ printThis /* located in the root, so it can be called from anywhere */ <dtml-var css_global> /* this maintains the formatting that is referenced in standard_html_header */ <dtml-var body> /* walah, we have isolated the main content so that it can be printed cleanly */ It was this logic that excited me about Zope a couple months ago. I hope this helps any newbie's like myself, that still arent proficient in python, but digging objects!! Now if I could just rebase my zClasses easier...hmmm -Trevor
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Peter Borocz Sent: Wednesday, August 29, 2001 11:23 AM To: 'Jan Ulrich Hasecke'; zope@zope.org Subject: RE: [Zope] printable page
I also saw that on Zope pages and then spent way too much time trying to find out how to do it from mailing lists etc. when I had the same epiphany that you did that simply "stripping" the navigation out of the standalone dtml-doc/methods would do it for my entire site. Thus, here's the link that I cobbled together that's in my standard html_footer (in this case, I use pp as the variable instead of printable as I thought that "might" be the standard):
<a href="&dtml-URL0;?&dtml-QUERY_STRING;&pp=1"> <img src="zImages/printable" border="0" alt="printer-friendly version"> </a>
I can't vouch for the "Zope" correctness of the URL variable though it seems to work for me. Cheers Peter Borocz
-----Original Message----- From: Jan Ulrich Hasecke [mailto:janulrich.hasecke@web.de] Sent: Wednesday, August 29, 2001 7:03 AM To: zope@zope.org Subject: [Zope] printable page
Hi,
I saw that on zope.org you can get printable pages. How are they generated?
I also want to integrate printable pages in my project. I want to do this by changing the standard_html_header.
I would insert in standard_html_header something like this:
<dtml-if expr="printable"> <html> <head> print-stylesheet <body>
<dtml-else> <html> <head> screen-stylesheet <body> ...complex navigation
</dtml-if>
Similar in standard_html_footer.
What would be the right if-construction and how can I set the condition "printable" dynamically from inside the given DTMLDocument. The Document should have a button or link which sets the condition printable while loading itself again.
TIA juh -- 6 Millionen arme Sünderlein http://www.sudelbuch.de/2000/20000807.html
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
------------------------------------------------- PLEASE READ THIS WARNING: All e-mail sent to or from this address will be received or otherwise recorded by the Fisher Investments corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )