Hi all, the common mistake which seems to manifest with this discussion is to assume, zope is by any means a classic webserver. It is not. So index_html is merely like pythons __str__() method on objects. Usually, __str__() does not represent content by itself, its a view to the content of the object. Putting content pages together does not mean to use zope. Using zope one would plan a hierarchical display of content. Unfortunately zopes installation does a bad example of using zope in respect of content representation. Every page is cluthered with <dtml-var standard_html_header> and footer. Using zope the right way would eihter include building (Z-)Classes for document types which render their unique content or at least using acquired index_html methods on folder objects. The folder object then becomes the smallest publicable content element. (reachable via URL) (URLs containing index_html are considered bad style ;) The more or less static content can then go to an object like "content" or "de", "en" or such. (Which can be a DTML Document). Properties are the properties of the folder object. It should only contain the difference to all other pages where index_html calls some methods to render navigation elements and more. So index_html schould really be a method. If the content is really large, it will probably never be read ;) If its meant to be downloadet, there are file objects... Regards Tino --On Mittwoch, 27. Juni 2001 16:46 +0000 Garry Steedman <gs@styrax.com> 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
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." +-------------------------------------------+
_______________________________________________ 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 )