[Zope] simple but annoying

Brad Bollenbach brad@codeworks.lt
Mon, 4 Nov 2002 11:30:25 +0200


On Mon, Nov 04, 2002 at 05:15:21AM +0100, jonatan wrote:
> On Mon, 2002-11-04 at 04:10, Dylan Reinhardt wrote:
> > DTML Methods don't have their own namespace, they use that of their 
> > parent.  That's why you're getting the title/id of the containing folder.
> > Use a DTML Document instead... that should give you what you want.
> 
> but then in my dtml document i cant do what i can in dtml methods...

You can't?

DTML Methods and DTML Documents are nearly the same thing, except that
DTML Methods are -- as the name would imply -- effectively just
methods of their containers, rather than stand-alone, contentish
objects like DTML Documents. This subtle difference is why DTML
Methods are categorized as presentation objects (meant to do
interesting things on other objects in their container) and DTML
Documents are categorized as content objects. From that perspective,
you'll understand why when you refer to a property in your DTML
Methods, you're getting the property of its container, rather than the
property of the method itself.

Refer to the relevant chapter in the Zope Book, "Basic DTML":

http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/DTML.stx

or the How-To on the subject:

http://www.zope.org/Members/michel/HowTos/DTMLMethodsandDocsHowTo

If that still doesn't clear up the issue, please elaborate on what you
can't do with a DTML Document that you can do with a DTML Method.

Brad