Easy DTML way for layout.
Hello, I ran into a problem with Zope. I'd like to use it to create a consistent layout for a midsize webpage. The layout is very simple; I'd like Zope to insert the same header, body and footer for all pages with minor color differences that can be handled by CSS. The header will contain a tool bar--for example, a simple table with links in it. Then my standard_html_footer or whatever I choose my DTML footer tag to be will look like this: <dtml-var css-code> <dtml-var toolbar-code> This is where I have a difficulty; what if I want my toolbar to have a minor difference from every page? For example, what if when page 1 is visited, I'd like the page 1 link to be in bold? I could make a ton of different dtml-vars for each part of the toolbar but that would take a ridiculous amount of time, if it works at all, and defeat the whole purpose of using Zope for the easier layout. I'm sure there's a "standard" solution to this--how can I achieve such easy consistent layout in Zope? Thanks a lot, -- Jordan Katz <katz@underlevel.net> | Mind the gap
Give each page a property 'pagenumber' containing -you guessed it- its pagenumber, create a list 'pages' consisting of all your pagenumbers and use something like: <dtml-in pages> <dtml-if "_['sequence-item'] == pagenumber"> <b>page <dtml-var pagenumber></b> <dtml-else> page <dtml-var pagenumber> </dtml-if> </dtml-in> hth, cb ----- Original Message ----- From: "Jordan Katz" <katz@underlevel.net> To: <zope@zope.org> Sent: Saturday, March 09, 2002 7:27 AM Subject: [Zope] Easy DTML way for layout.
Hello,
I ran into a problem with Zope. I'd like to use it to create a consistent layout for a midsize webpage. The layout is very simple; I'd like Zope to insert the same header, body and footer for all pages with minor color differences that can be handled by CSS. The header will contain a tool bar--for example, a simple table with links in it. Then my standard_html_footer or whatever I choose my DTML footer tag to be will look like this:
<dtml-var css-code> <dtml-var toolbar-code>
This is where I have a difficulty; what if I want my toolbar to have a minor difference from every page? For example, what if when page 1 is visited, I'd like the page 1 link to be in bold? I could make a ton of different dtml-vars for each part of the toolbar but that would take a ridiculous amount of time, if it works at all, and defeat the whole purpose of using Zope for the easier layout. I'm sure there's a "standard" solution to this--how can I achieve such easy consistent layout in Zope?
Thanks a lot, -- Jordan Katz <katz@underlevel.net> | Mind the gap
_______________________________________________ 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 )
On Sat, 9 Mar 2002, Kees de Brabander wrote:
Give each page a property 'pagenumber' containing -you guessed it- its pagenumber, create a list 'pages' consisting of all your pagenumbers and use something like: <dtml-in pages> <dtml-if "_['sequence-item'] == pagenumber"> <b>page <dtml-var pagenumber></b> <dtml-else> page <dtml-var pagenumber> </dtml-if> </dtml-in>
hth, cb
Another possibility is to handle this w/site structure: Suppose you have a site with the following folder structure: |- About |- Mission |- Legal |- Products |- Transmorgrifier X500 |- Customer Service |- Returns Rather than marking every page (Mission, Legal, etc.) with a property for what section they fall in, you can simply put the changable parts in their folders. So, you'd have: /standard_html_header: <html><body><table><tr><td><dtml-var toolbar></td></tr><tr><td> and in /about/toolbar: You are in ABOUT and in /about/PRoducts: You are in PRODUCTS and so on. This way, you're using the structure of your site and acquisition to provide the navigation feel you want. If you don't want to have different toolbar methods in each folder, you could put it in the standard_html_header, and have it figure out where you are by examining the REQUEST.PARENTS object, which lists the parents of the called object. This way, it could handle different appearance differently without having to store a property with every object in the site (which can get hard to maintain.) I prefer the acquisition choice, though. More Zope-like and more flexible. -- Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Independent Knowledge Management Consultant
On Sat, Mar 09, 2002 at 11:19:16AM -0500, Joel Burton wrote:
|- About |- Mission |- Legal |- Products |- Transmorgrifier X500 |- Customer Service |- Returns
I've got two instances of a similar structure already up and running. The one that uses NFGNav can be seen at http://www.cae.tntech.edu/ ; the one still in development (using Python Scripts, CSS, and Page Templates) can be seen (temporarily, at least) at http://ch315.cae.tntech.edu:9673/ The NFGNav version is written up at http://www.zope.org/Members/mwr/ ; the Python/ZPT one just got finished, and I hope to write it up in the next day or so (man, did I pick up a lot of ZPT in the last couple of days). -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
On Sat, Mar 09, 2002 at 09:22:10PM -0600, Mike Renfro wrote:
The NFGNav version is written up at http://www.zope.org/Members/mwr/ ; the Python/ZPT one just got finished, and I hope to write it up in the next day or so (man, did I pick up a lot of ZPT in the last couple of days).
Rough draft of the Python/ZPT sitemap is now at http://www.zope.org/Members/mwr/python_zpt_sitemap/index_html?pp=1 -- waiting to be catalogued. Email suggestions for improvement. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
participants (4)
-
Joel Burton -
Jordan Katz -
Kees de Brabander -
Mike Renfro