[Zope] index_html, method or doc?

Flynt rhess@bic.ch
Wed, 27 Jun 2001 18:09:04 +0200


Casey Duncan wrote:
> 
> Garry Steedman wrote:
> >
> > gents,
> >
> > i have to disagree with the two previous posts on this thread: i can see no
> > reason why one _should_ use methods instead of docs for index_html unless
> > one has a particular requirement: in other words, i would recommend docs
> > for content (index_html usually hold content, no?) unless you have a good
> > reason for using methods. this is also more consistent with the zope
> > documentation (NB AFAIK the Zope Book does not seem to recommend methods
> > over docs for content, but please correct me if i'm wrong on this)
> >
> > [http://www.zope.org/Documentation/Guides/ZCMG-HTML/ZCMG.7.html]
> > (yes, i know it's old ;-):
> >
> > "DTML Documents are used to hold content. If you want to store a large
> > document, or lots of text, or a body of information, use a DTML Document.
> >
> > DTML Methods are used to carry out actions. If you want to render another
> > object (like a DTML Document), execute a DTML script, or generate lots of
> > dynamic content, use a DTML Method.
> >
> > Also, you may notice that the DTML Document management interface has a
> > Properties view and the DTML Method management interface does not. This is
> > because DTML Documents can have properties like all other Zope objects.
> > DTML Methods share the properties of the folder than contains them."
> >
> > note that having content in docs facilitates clean indexing among other
> > things...
> >
> > cheers,
> >
> > Garry
> >
> 
> Here are the simple rules I would use:
> 
> If the index_html is only going to be accessed/called by it's direct URL
> and not acquired from some other folder then use a DTML Document;
> otherwise use a method.
> 
> --
> | Casey Duncan
> | Kaivo, Inc.
> | cduncan@kaivo.com
> `------------------>

I like these simple rules. Because I usually make use of the acquisition
mechanism, I use DTML methods for the index_html. And Joachims
contribution explains very well the background.

I know the principle *docs for content* (Garry, yes, this is emphasized
also in the Zope book), but I remember very well, that when I was
starting to play around with Zope I chose a document for the index_html
right for this reason (thinking that it is content) and promptly got
caught (I followed the examples in the Zope book and it was _not_
working until I realized, I had to use a method for the index_html).


--- Flynt