[Zope] <dtml-let> syntax

Casey Duncan cduncan@kaivo.com
Fri, 20 Apr 2001 10:14:32 -0600


Sebal wrote:
> 
> I want to test in a sequence if sequence-index is multiple of 4
> 
> I think I can with fmod(sequence-index,4)=0 but I don't find the right
> syntax:
> 
> I tried directly in the <dtml-if> tag and with a <dtml-let> tag like :
> (I tried with or without " [ _[ ' .... nothing works)
> 
>    <dtml-in SQLmotcle_query>
>    <TD CELLPADDING="0" CELLSPACING="0" VALIGN=MIDDLE ALIGN=LEFT>
>     <dtml-let x=fmod(sequence-index,4))>
>      <dtml-if x>  poipoi
>      <dtml-else>  pokpok
>      </dtml-if>
>     </dtml-let>
>    </dtml-in></TD></TR>
> 
> What is the right syntax, or is there another way to test this.
> thanx.

<dtml-if expr="_['sequence-index'] % 4">
    poipoi
<dtml-else>
    pokpok
</dtml-if>

"%" is the Python modulus operator.

hth,
-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>