[Zope] Zope Patterns

Paul Winkler pw_lists at slinkp.com
Thu Jan 15 10:52:38 EST 2004


On Thu, Jan 15, 2004 at 01:52:22PM +0100, Douwe Osinga wrote:
> Hi Zopers,
> 
> I have a musing about how Zope sites are set-up which I would like to share
> and would very much like comments on.
> 
> Typically, a web page has a header, a body and a footer. In most Zope
> instances, this is translated into standard_html_header,
> standard_html_footer, while an index_html calls these and does something
> interesting in between.

or we use page templates and have a main_template instead of
standard_html_*...

> I don't like this setup too much, because it explicitly repeats the calling
> of standard_html_* for every page.

I don't see how this is true given your structure below.

> If you want to add a parameter to for
> example standard_html_header (say the css to use or similar), you'll have to
> change all pages (yes, you can use default parameters, but that is not the
> point). So I usually end up with a structure like this:
> 
> root
>    index_html
>    standard_html_footer
>    standard_html_header
>    mainbody
>    folder1
>        mainbody
>    folder2
>        mainbody
> 
> where index_html calls header, mainbody and footer. This works great, except
> for that you need a folder for any page that needs to display the structure.

What's wrong with that? It's a pretty sensible way to do it IMHO.
Admittedly, cataloging is a bit of a pain because you want to 
catalog each folder's mainbody but have the search result point you to
the folder, not to mainbody.

> If you want add a method to the root folder that is applicable to everypage,
> then this method needs to call the structure again.

What does "call the structure" mean?

> Do other people recognize this pattern? Other solutions?

Write your own content type as a Product.
At a certain point it's easier than maintaining a pile of
scripts & methods.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's KABUKI WARRIOR DESTRUCTO-FINALE!
(random hero from isometric.spaceninja.com)



More information about the Zope mailing list