----- Original Message ----- From: Jonothan Farr <jfarr@real.com>
Yesterday I announced a patch on the Zope list that adds a <dtml-break> tag which allows you to break out of a <dtml-in> iteration like so:
<dtml-in sequence> <dtml-if condition> <dtml-break> </dtml-if> <dtml-var sequence-item> </dtml-in>
I'm just wondering what you folks on the zope-dev list and at DC think about adding something like this to the Zope core before my patch gets lost in the collector.
I like it well enough, although with the proposed changes at http://www.zope.org/Members/4am/DTMLWiki/NamedDTMLInLoop I would prefer it to be a method of the iterator rather than a tag, so that you would write: <dtml-in sequence> <dtml-if condition><dtml-call sequence-break></dtml-if> <dtml-var sequence-item> </dtml-in> ...or in the case of nested loops: <dtml-in seq1 var=loop1> <dtml-in seq2 var=loop2> <dtml-if condition><dtml-call loop1/sequence-break></dtml-if> <dtml-var loop1/sequence-item>, <dtml-var loop2/sequence-item> </dtml-in> </dtml-in> Cheers, Evan @ digicool & 4-am