[ZPT] Any reason this wouldn't work?

Lynn Walton waltonl@franklin.edu
Tue, 11 Sep 2001 14:04:55 -0500


Evan Simpson wrote:

> I regret that I still don't really understand the problem that you're
> trying to solve.

I was looking into using Zope because I see several content management related
applications that I'd like to have in place in the future on our site. But
before we get to that, we have to roll out a new look and feel that will contain
hundreds of "mostly static" html documents that contain information currently on
our old site. But, we also have a significant number of cases of chunks of data
that get reused throughout other documents.  If I were using SSI I'd use
#includes. If using JSP or PHP - it's include facilities to achieve some of
this.

I started out studying ZPT because I liked the looks/use of it more than dtml.
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".  While I know that, and agree
with ideas of separating presentation from content .... I was hesitant to "drink
the CMF Kool-ais" (also Ethan's words I believe) due to the complexity of CMF
and it's unstructured documentation. But I decided to go for it.

So I planned on having my hundreds of mostly static html pages that need
presented be my own CMF object that is just a CMFDocument but with some
"properties" set that the master template's call to the external method that
builds the menus need.   At this point in time, I really don't want the site to
be a portal. I don't want regular uses to even see a login or join type of
thing, so already I have to do some customizing of the standard CMF portal to
make it less portal like. But because my different web staff members need to
make and edit the documents, they need to login to the portal because that's the
only way to create/edit portal content.

But now, when I want to start handling the dozens of different kind of documents
where I want to reuse some content, I need to create a ZPT in order to have the
facility to do some basic logic .... even if it's just an include like command,
to pull in say some other document's cookedBody into this document.   Or if I
want to use a macro that doesn't have a set defined slot in some other
template.    The kind of reuse I'm talking about isn't like say the Actions Box
or News Item where you always no where in the page layout it should occur, so
you include it a template that is used by all documents of a certain type.
Instead, I'm talking about content reuse where the spot in the page that the
included/reused content may need to be pulled in is different in each of the
various documents I will want to use it in. Thus each different document that
will have some reuse of common data will need to be it's own template.  Thus I
could end up with lots of ZPTs containing content and I'm back to not being much
ahead of if I'd just made ALL my several hundred pages each ZPT's that used a
master template, and didn't use CMF at all.

If I try to use CMF for the hundreds that don't have reuse then it seems
weird/awkward, to have a mixure of many items on the site are CMFDocuments (or
my variation) and many others are ZPT's that are kept in the portal's different
subdirectories.  It seems to make providing site wide searching more difficult
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 (that is the ability to use tal and metal to pull in stuff I want when
needed.)  So I could have hundreds of plain CMFDocument like objects, but dozens
of others that are this new suped up CMF-PageTemplate mix type object that can
give me the control for deciding what data to bring in at what spot by using
some tal and/or metal.

Here is an example of a way I forsee reusing different data in different web
pages in different places on those different pages.
If we have a contact database we're accessing. Of course we'll have some
templates that are truly serving as templates to present just different views of
the contact database's data.   But, we also have all kinds of different pages of
university information that will may refer to a particular person in different
ways and different spots, but we'd rather get their name/email/title, etc from
one database than hard code it in 10 different types of pages.   I'd need to use
dtml or zpt to make the appropriate calls to get back the info.  So if I make it
a zpt that uses my master template to get the look and feel, but then I have
paragraphs, tables, lists etc of CONTENT all filling in the main "slot"
including a call to get the info on a person who is mentioned some place on the
page, then that ZPT itself  IS content. But I have to use zpt in order to get to
make the call to get my reusable data.

Does this give you more of an idea of my dilemma?

Thanks for your patience.
Lynn