[Zope] [Q] iterating over objects in two's ...

Darran Edmundson Darran.Edmundson@anu.edu.au
Thu, 11 Nov 1999 20:08:45 +1100


I wish to iterate over a number of images, putting 'n'
images per row in a table.  Something like the following:

<table><tr>
<dtml-in "objectValues(['Image'])">
   <td><img src=<dtml-var id>></td>
   <dtml-if n_images_in_current_row>
       </tr>
       <dtml-if not_last_row>
          <tr>
       </dtml-if>
   </dtml-if>
</dtml-in>
</table>

I take it this isn't batch processing since I want all
images rendered in the one table.  My guess is to
use a temporary variable, increment it during each iteration,
and check the value modulus n.  Any advice is much
appreciated.

Cheers,
Darran.

-- 
Darran Edmundson [Darran.Edmundson@anu.edu.au]