[Zope] dtml-in question

Michael Gutmann gutmann@uni-duesseldorf.de
Mon, 02 Jul 2001 11:59:16 +0200


Ismet Dere wrote:

> Helloa all,  
> pls. pardon me if my question is sily, i'm a newbie. :)
> in zope 2.3x
> with <dtml-in> tag,
> how to list the objects that has property "menu" ? in a particular folder?
> for example, i want to list objects that has "menu" property in folder = 
> /products/books
> with a DTML_Method in folder = /products/music
> how to do that?


Well, quick and with no guarantee ;-) there are two steps necessary, I assume:
1) Get a list of all the objects you need. If you are in folder products/music,
maybe with:

<dtml-in "books.objectValues([])">
</dtml-in>

or with

<dtml-with books>
   <dtml-in objectValues>
   </dtml-in>
</dtml-with>

2) Now you can test, if the property exists, f.e. with

     <dtml-if menu>
     </dtml-if>


> thanks for your help
> 
> ismet 

Didn't test it, but I hope the principle is clear,
Michael


-- 
Michael Gutmann M.A.
gutmann@uni-duesseldorf.de
Multimediazentrum Heinrich-Heine-Universitaet Duesseldorf