[Zope] how to iterate through two sequence items

seb bacon seb@jamkit.com
08 Feb 2002 10:23:09 +0000


On Fri, 2002-02-08 at 09:31, Peter Walerowski wrote:
> hello all,
> sorry, forgot the subject.
> 
> my problem might be simple, but I can't find the solution:
> I can iterate through a sequence - let's say a folder content - and display the 
> items in a table, but I can't figure out how to display the table in two 
> columns.
> 
> <dtml-in myFolderContent>
>  <tr><td><dtml-var folderItem></td></tr>
> </dtml-in>
> 
> will print the dates in a single column, but how can I iterate through and refer 
> to a second item in one <dtml-in> pass.

Untested, but should point you in the right direction:

<dtml-in foo>
 <dtml-if sequence-odd>
  <tr>
 </dtml-if>
 <td><dtml-var sequence-item></td>
 <dtml-if sequence-even>
  </tr>
 </dtml-if>
</dtml-in>

seb