[ZPT] Any reason this wouldn't work?

Evan Simpson evan@zope.com
Tue, 11 Sep 2001 15:46:00 -0400


Lynn Walton wrote:

> I developed a master template that includes a call to an external method which
> builds a menu based on the presence of some "properties" in the ZPT that is
> calling the master template.  So, I was heading down the road of creating
> hundreds of ZPT's that declare some properties at the top, and have a use-macro
> that calls the master template.   Then Ethan Mindlace replied to one of my
> questions saying "Page Templates are NOT content".


Hmph.  I think this depends on what you mean by "content".  If you have 
hundreds of pages that have different layouts, with more complex 
structure than can be captured well with structured text, then I'd say 
that Page Templates are a fine solution.  After all, if you pull a chunk 
of complex HTML into some kind of content object, then plug it back into 
a master template, I don't see what has been gained.


> since the ZPT's wouldn't be part of the portal catalog ( unless someone tells me
> I can make them be part ... I'm still very fuzzy on the cataloging.).   So it
> seemed to me that what I needed was a CMF object that had page template
> abilities


You want ZPTs that participate in the portal_catalog, yes?  Given that 
you're using the CMF, it's probably sufficient to make a filesystem 
class that mixes ZopePageTemplate with PortalContent (ZPT first!).  I 
wouldn't bother with a ZClass; skins give you the best part of those 
without the headaches.


Cheers,


Evan @ Zope