Morten W. Petersen wrote:

> Specifically, the reason I want this function is that I feel using
> <dtml-if sequence-even>
>       <tr bgcolor="<dtml-var color_sequence_even>">
> <dtml-else>
>       <tr bgcolor="<dtml-var color_sequence_odd>">
> </dtml-if>
> is a bit tedious (and ugly!) in the long run..

If this is what you want to do, there's an easier way from DTML:

<dtml-let colours="('blue', 'yellow', 'green')"
<dtml-in "_.range(10)">
   <dtml-let row_index=sequence-index
             colour="colours[row_index % num_colours]">

   <font color=&dtml-colour;>
   this is row &dtml-sequence-item;


Steve Alexander
Software Engineer
Cat-Box limited

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to