Re: [Zope] Gettin all images of a folder
Ok it works... But WHY do I have to <dtml-with Images> ??? As really don't understand :( thx anyway ! ----- Message d'origine ----- De : Rik Hoekstra <fghoekstra@cit10.wsd.leidenuniv.nl> À : Olivier Deckmyn <odeckmyn.list@teaser.fr>; <zope@zope.org> Envoyé : mardi 28 septembre 1999 15:49 Objet : RE: [Zope] Gettin all images of a folder
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Olivier Deckmyn Sent: Monday, September 27, 1999 3:34 PM To: Zope Mailing List Subject: [Zope] Gettin all images of a folder
Hi all,
I have a folder : /MyFolder
In this folder there is another folder : /MyFolder /Images
The Images folder contains both images and some DTML documents.
I would like to be able to display the list of all available images.
What is the DTML script to write to iterate through all the images of
the
Images folder ?
smthg like : <!--#in Images> <!--#var "in-item.name"--> </...>
If you want a list of image names try
<dtml-with Images> <dtml-in "objectValues(['Image]')"> <dtml-var title_or_id> </dtml-in> </dtml-with>
If you want a list of images:
<dtml-with Images> <dtml-in "objectValues(['Image]')"> <dtml-var sequence-item> </dtml-in> </dtml-with>
Rik
P.S. I assume you're using zope2 and used the preferred new dtml syntax. If you want to put it in the old syntax (or have to if you use zope1) replace <dtml-...> with <!--#...-->
Olivier Deckmyn wrote:
Ok it works...
But WHY do I have to <dtml-with Images> ???
As really don't understand :(
Because you want the images from the folder (object to Zope) Images, not from the current namespace (=folder or DTML object and all that is acquired from the acquisition hierarchy). What the with tag really says is take the namespace of the (folder) object Images and make a list (the in tag) of all objectValues of a type 'Image' then do something with them (what the dtml-in tag embraces) For a more advanced treatment of the with tag see http://www.zope.org:18200/Members/michel/HowTos/WithTagHow-To Rik
participants (2)
-
Olivier Deckmyn -
Rik Hoekstra