[ZDP] BackTalk to Document The Zope Book (2.5 Edition)/Advanced Page Templates
Wed, 25 Sep 2002 20:40:45 -0400
A comment to the paragraph below was recently added via http://www.zope.org/Documentation/Books/ZopeBook/current/AdvZPT.stx#3-45
If you want to override the ordering of TAL statements, you must
do so by enclosing the element in another element, possibly
'div' or 'span', and placing some of the statements on this new
element. For example suppose you want to loop over a series of
items but skip some. Here's an attempt to write a template that
loops over the numbers zero to nine and skips three::
<!-- broken template -->
<li tal:repeat="n python:range(10)"
tal:condition="python:n != 3"
% gotcha - Apr. 22, 2002 4:22 am:
> If you want to override this ordering, you must do so by enclosing
> the element in another element, possibly div or span, and placing
> some of the statements on this new element.
This sentence could be removed and replaced by something like:
tal: prefixed elements are allowed and interpreted. Further, any tal: prefixed element has a default
tal:omit-tag like behaviour.
If you want to override this ordering, you can use tal: prefixed elements.
<tal:formfields repeat="field python:form.get_fields()">
<tal:fieldid define="fieldId python:field.getId()">
% Anonymous User - Apr. 29, 2002 4:06 pm:
This new example took the polar route as it both introduces a new concept without explaining it well and does
not solve the problem identified in the example above.
were you instead suggesting:
<tal:loop repeat="n python:range(10)">
<li tal:condition="python:n != 3" tal:content="n">1</li>
% Anonymous User - Aug. 8, 2002 7:59 pm:
...statement can be used on a single tag. Since HTML does not...
...statement can be used on a single tag, since HTML does not...
% Anonymous User - Sep. 25, 2002 8:40 pm:
/and placing/and place/