[Zope] what's the equivalent of sequence-item and sequence-key in tal:repeat

Felix Ulrich-Oltean felix@chaptereight.com
10 Feb 2003 11:24:14 +0000


On Mon, 2003-02-10 at 10:41, Joachim Schmitz wrote:
> what is the equivalent of this DTML snipplet in TAL ?
> 
> <dtml-in get_all_languages>
>  <option value="<dtml-var sequence-key>" size=40 <dtml-if 
> "_['sequence-key'] in
> getLanguages()">selected</dtml-if>><dtml-var sequence-item></option>
> </dtml-in>
> 

Something like:

<option size="40"
        tal:repeat="lang here/get_all_languages"
        tal:attributes="value repeat/number/index;
                        selected python:repeat['lang'].index in \
here.getLanguages() and 'yes' or nothing"
        tal:content="lang">Language</option>

More about this in the ZPT reference, Appendix (C) of the Zope Book:
http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition

The sequence stuff is covered under the "repeat" statement.

F.