[Zope] Gettin all images of a folder

Rik Hoekstra hoekstra@fswrul.fsw.leidenuniv.nl
Tue, 28 Sep 1999 15:49:46 +0200


> -----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 <!--#...-->