[Zope] Zope Patterns
Douwe Osinga
dmo at oberon.nl
Thu Jan 15 13:54:40 EST 2004
> > 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_*...
Yes, but that doesn't make much of a difference in the end.
> > 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.
Not in the structure I describe below. More if I add a login method
somewhere
and I want to call the login method directly, the login method has to
take care of rendering itself including the template in whatever form
correctly.
> 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.
Nothing really wrong, just that you end up with a lot of folders and
some folders aren't really folders and just contain a mainbody script.
It's odd and doesn't feel too good.
> > 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?
Well, let's say I add a search method in the root, which would allow
searching in subfolders or something. Then I either end up with
complicated acquisition and context issues, or I just put a script
in the root that calls the template or standard_html* stuff.
> > 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.
Yes, I do that usually. I just wondered what other people thought.
Regards,
Douwe Osinga
http://douweosinga.com
More information about the Zope
mailing list