[Zope] using "sequence-even" in nested "dtml-in" loops?

Dylan Reinhardt zope at dylanreinhardt.com
Thu Aug 7 22:28:02 EDT 2003


When you use nested dtml-in's, you should use the prefix attribute. 
It's not a bad idea to make a habit of using prefix anyway.

Example:

<dtml-in sql_get_pe_ids prefix=id>
   <dtml-in sql_get_pe_contact_info prefix=contact>
      <dtml-if contact_even>

The prefix (plus an underscore) replaces "sequence-" in the normal loop
variable names.

HTH,

Dylan



On Thu, 2003-08-07 at 13:37, Sajec, Mike TQO wrote:
> Hello,
> 
> If someone can help with this, I would really appreciate it.
> 
> I'm trying to setup alternating colors in a query built table.  I'm
> attempting to key off the sequence-even variable to set the row colors.  The
> problem that I'm seeing is that sequence-index always equals zero, which
> makes sequence-even always true, and every row grey.  It appears that
> sequence-index is looking at the outer loop.  Any hints?
> 
> Thanks in advance,
> Mike
> 
> 
> <p>
> <table class="listing" id="contact_list">
> <thead>
> <th>Name</th>
> <th>Position</th>
> <th>Phone</th>
> <th>Pager</th>
> <th>Cell</th>
> <th>Email</th>
> </thead>
> <tbody>
> <dtml-in sql_get_pe_ids>
>    <dtml-in sql_get_pe_contact_info>
>       <dtml-if sequence-even> #*******************HERE
>          <tr bgcolor="gray">     #*******************HERE
>       <dtml-else>                   #*******************HERE
>          <tr>                           #*******************HERE
>       </dtml-if>                       #*******************HERE    
>          <td><dtml-var last_name>, <dtml-var first_name></td>
>          <td><dtml-var job_title></td>
>          <td><dtml-var ext></td>
>          <td><dtml-var pager></td>
>          <td><dtml-var cellphone></td>
>          <td><dtml-var email></td>
>          </tr>
>    </dtml-in>
> </dtml-in>
> </tbody>
> </table>
> </p>
> 
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )




More information about the Zope mailing list