[Zope] how to iterate through two sequence items

Peter Walerowski peter.walerowski@densxl.de
Fri, 8 Feb 2002 11:41:13 +0100


>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>

ok, this works but my problem is more complex.
I need something like this:

<dtml-in "objectValues('my Object')>
<tr>
  <td><dtml-var expr="getProperty('firstProp)"></td>
 <td><dtml-var expr="nextItem.getProperty('firstProp)"></td>
</tr><tr>
  <td><dtml-var expr="getProperty('secondProp)"></td>
 <td><dtml-var expr="nextItem.getProperty('secondProp)"></td>
</tr>
</dtml-in>

and my table should look like:

  -----------------------------------
  | 1.item - 1.prop |2.item - 1.prop |
  -----------------------------------
  | 1.item - 2.prop |2.item - 2.prop |
  -----------------------------------
  | 3.item - 1.prop |4.item - 1.prop |
  -----------------------------------
  | 3.item - 2.prop |4.item - 2.prop |
  -----------------------------------

using only sequence-even or sequence-odd i'll get trouble with the rows.

peter 

----- d e n s  X L -------------------- medien konzepte design ---

peter walerowski                          tel: +49(0)30 218 055 53
nehringstr. 16                            fax: +49(0)30 326 050 89
14059 berlin                            mobil: +49(0)179 47 843 47

------------------------------------------------ www.densxl.de ---
--
berlin.de - meine stadt im netz. Jetzt eigene eMail-adresse @berlin.de sichern!
http://www.berlin.de/home/MeineStadt/Anmeldung