----- Original Message ----- From: Dennis Nichols <nichols@tradingconnections.com>
Let's say that I want to make a list of nodes from the top down (the reverse of PARENTS). Easy enough:
<dtml-call "REQUEST.set('topdown', [])"> <dtml-in PARENTS skip_unauthorized> <dtml-call "topdown.insert(0, _['sequence-item'])"> </dtml-in>
However, what I really want to do is quit reversing when I get up to a particular level, say the point at which I get to my Portal folder.
But I find no documentation on a break command. Is there any such construct in dtml?
'Fraid not. The best I can think of offhand is: <dtml-call "REQUEST.set('topdown', [])"> <dtml-call "REQUEST.set('loopdone', 0)"> <dtml-in PARENTS skip_unauthorized> <dtml-unless loopdone> <dtml-call "topdown.insert(0, _['sequence-item'])"> <dtml-if "...last iteration..."> <dtml-call "REQUEST.set('loopdone', 1)"> </dtml-if> </dtml-unless> </dtml-in> Cheers, Evan @ digicool & 4-am