[Zope] printable page
Trevor Toenjes
zope@toenjes.com
Wed, 29 Aug 2001 18:01:04 -0400
I created a "Printable Page" that is very simple if you use a "main conte=
nt"
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 exi=
sts
once at the root. Everything inherits from this one file. However, ever=
y
folder has a "body" method. <kinda like BODY in HTML> "body" is the loca=
l
content template for that folder.
example: index_html /* this looks like your standard page layo=
ut
with navigation on the left */
<dtml-var standard_html_header>
<table>
<tr>
<td><dtml-var navbar></td> /* navbar can include smart trees, BTW-the=
re
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=3D"printThis">... /* this can be anywhere, because you are inheri=
ting
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 referenc=
ed
in standard_html_header */
<dtml-var body> /* walah, we have isolated the main content so t=
hat
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 pytho=
n,
but digging objects!! Now if I could just rebase my zClasses easier...hm=
mm
-Trevor
> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Pete=
r
> 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 t=
o
> find out how to do it from mailing lists etc. when I had the same epiph=
any
> that you did that simply "stripping" the navigation out of the standalo=
ne
> 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=3D"&dtml-URL0;?&dtml-QUERY_STRING;&pp=3D1">
> <img src=3D"zImages/printable" border=3D"0" alt=3D"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=3D"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=FCnderlein
> 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-m=
ail
> 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 )