[Zope] index_html, method or doc?

Garry Steedman gs@styrax.com
Wed, 27 Jun 2001 16:46:58 +0000


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

On 27 Jun 2001, at 14:24, Joachim Werner wrote:

From:           	"Joachim Werner" <joe@iuveno-net.de>
To:             	"Flynt" <rhess@bic.ch>, "Jan Sew" <esolutions@gmx.net>
Copies to:      	<zope@zope.org>
Subject:        	Re: [Zope] index_html, method or doc?
Organization:   	iuveno AG
Date sent:      	Wed, 27 Jun 2001 14:24:47 +0200

> > You have to use DTML methods for the index_html (usually you will
> > want to include some other methods like standard_html-header and
> > standard_html_footer in your index_html). Did you have a look into
> > the Zope Book ?
> 
> That's not quite correct. Both DTML Methods and DTML Documents work
> fine, but different:
> 
> As a DTMLMethod, index_html will try to "acquire" all the parts it
> needs locally, e.g.
> 
> you have a folder structure like this:
> 
> ROOT
> |--- index_html
> |--- standard_html_header (with white background)
> |--- standard_html_footer
> |--- GREEN
> |      --- standard_html_header (with green background)
> --- RED
>       --- standard_html_header (with red background)
> 
> RED/index_html will have a red background and GREEN/index_html will
> have a green one. Same with title attributes etc.
> 
> If you use a DTML Document, it will only look for the "local" stuff,
> i.e. it will take its own title if you say "<dtml-var title>", and it
> will take the standard_html_header from the ROOT, which is white in
> the example.
> 
> The other difference is that DTML Methods does not have properties at
> all. It can just acquire them. In most cases, people would use DTML
> Methods for almost everything. Only if you import HTML documents from
> the outside, it might be better to use DTML Documents.
> 
> 
> Cheers
> 
> Joachim
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )


+-------------------------------------------+
  Garry Steedman      mailto:gs@styrax.com  
  Styrax Associates  http://www.styrax.com/ 

  "The Good Man has no shape."            
+-------------------------------------------+