[Zope] dtml-in syntax

Kapil Thangavelu kvthan@wm.edu
Sun, 30 Jul 2000 07:08:21 -0700


A couple of different solutions depending on exactly what you want to
do. 

if you're just trying to get the total length of the records returned by
wherever you could try.

<dtml-let x=whatever>

<dtml-var "_.len(x)">

</dtml-let>

or if you want the distinct values as well

<dtml-in whatever>
<dmtl-var sequence-item><dtml-var sequence-number>
</dtml-in>

a great reference is the Zope Quick Reference
at http://www.zope.org/Members/ZQR

Check out the dtml-in docs.

Kapil


Kyle Burnett wrote:
> 
> so i have this loop and i want to count a variable:
> 
> <dtml-in wherever>
> 
>   <dtml-if sequence-start>
>    <dtml-var count-id>
>   </dtml-if>
> 
> </dtml-in>
> 
> but what i really want to count is specific values for id. so let's say
> id=='value1', i want to try and do the following:
> 
> <dtml-in wherever>
> 
>   <dtml-if sequence-start>
>    <dtml-var "count-id=='value1'">
>   </dtml-if>
> 
> </dtml-in>
> 
> but no luck. and i have tried several other make-shift syntaxes to no avail.
> 
> i do have some other logic that i could use over the course of the loop to
> determine the count of distinct values but i was try to do it in far less
> code.
> 
> anyone got an idea of how to rig this?
> 
> thanks in advance,
> kyle
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )