You are here:   » Home » Documentation » Details » How-To » DTML/Products » Home

break in <dtml-in>-loops

In Python you can get out of loops (for, while) by means of break. This is not intended in the <dtml-in> tag.

Solution: In the request object a break flag is set with entry of the break condition condition.

<dtml-call "REQUEST.set('break',0)">
<dtml-in list>
 <dtml-unless "REQUEST['break']"> 
  ...
  <dtml-call "REQUEST.set('break',condition)"> 
 </dtml-unless>
</dtml-in>