[Zope] Using batch processing in DTML

Dylan Reinhardt zope at dylanreinhardt.com
Wed Nov 26 11:01:01 EST 2003


On Wed, 2003-11-26 at 02:38, Mico Siahaan wrote:
> Hi, suppose I have folder gallery that contains 40 photos. I want to make
> a DTML page that previews these photos. Suppose I want to load 15 photos
> each view and I want to arrange that 15 photos into 5 columns and 3 rows
> format... how do I accomplish that? I have read the example in Zope book
> about batch processing, but in my case I guess I have to make other loops
> in the batch loop ( 2 more loops I guess). But I am confused about the
> inner loops: over what object should the inner loops interate?

You'll need to use the "prefix" attribute of dtml-in so that you can
distinguish one loop's objects from the others.  Ex:

<dtml-in rows prefix=row>
   <tr>
   <dtml-in cols prefix=col>
     <td><dtml-var "my_thing(col_item, row_item)"></td>
   </dtml-in>
   </tr>
</dtml-in>

HTH,

Dylan




More information about the Zope mailing list