[Zope] objectValues Question

Rik Hoekstra rik.hoekstra@inghist.nl
Wed, 3 Jan 2001 14:43:54 +0100


I'm new to Zope and while 'playing' around I wondered about the following:

I've created a DTML method (called MyListFiles) that lists the 'File'
objects contained in a folder:
<snip>
Now when I create a DTML document and call this method like this:

<dtml-var MyListFiles>

it produces no output.


Because DTML Documents are object of their own and DTML Methods are not.
THis means that if you are trying to get the 'objectValues' from the DTML
Method it will get them from the containing object, a Folder. If you try to
get them from a DTML Document, it will not return anything, as the DTML
Document holds no other objects. The solutions is to make the DTML Method
call its parent's (=containing object) objectValues. For example (untested):

<dtml-with expr="PARENT[0]">
    <dtml-var MyListFiles>
</dtml-with>

Rik