« Changing the content type in page templates | Main | Testing for the presence of objects in Zope »
April 20, 2005
Contingent DIV blocks in ZPT - a design flaw.
I've got a problem with the design of ZPT. If I want a DIV block which starts in one iteration of a tal:repeat
block but finishes a number of iterations later, then this can't be done, because the resulting code would give opening and closing tags out of document sequence breaking the template.
The only recourse seems to be to print the extra tagging as a a result of a tal:condition
test.. YUUUCK:
<tal:block
tal:define="
global counter python:counter + 1;
global odd_even python:root.new_site.odd_or_even(test_figure=counter);
"
tal:condition="python: odd_even == 'odd'"
tal:replace="structure string:<div class="row">"/>
....Then the same for the closing block...
<tal:block tal:condition="python: odd_even == 'even'" tal:replace="structure string:</div> <!-- End of row div -->"/>
Tags: ZPT
Posted by pj at April 20, 2005 04:13 PM