[Zope] A strange difference between DTMLDocument versus DTMLMethod Zope 2.2.2
Dieter Maurer
dieter@handshake.de
Thu, 21 Sep 2000 00:54:23 +0200 (CEST)
cuiod-tec Jens Gelhaar writes:
> The following few lines have a different result, when I execute it within an
> DTMLDocument or DTMLMethod.
>
> <dtml-var standard_html_header>
> <dtml-in "objectItems('Folder')">
> <dtml-var title_or_id>
> </dtml-in>
> <dtml-var standard_html_footer>
>
> The DTMLMethod result looks like it should be, but within a DTMLDocument the
> result is empty. When I modify the <dtml-in> tag slightly, then it works to
That is (almost) as it is supposed to be.
In both cases, "objectItems" is looked up in the so called
DTML namespace.
If your object is a DTML document, then the (relevant) top level
element is the document itself. If it is a DTML method,
the method itself is not placed on the namespace, only
its "client", i.e. the object for with the method has been
called (usually, but not necessary a folder).
The only maybe a bit surprising thing is that a DTML document
seems to have an "objectItems" method which, of cause,
returns the empty sequence.
If you use "PARENTS[0]", then you get a similar result
to that, you would have with a DTML method.
Dieter