If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Thanks Bill, this helps!
However, is there a way to set the value of pos1 to a value? And if this value is greater than the number of entries in the array, can this force an exit from the foreach loop?
The foreach loop goes quite fast, even if you have hundreds of entries. The easy thing to do is only display those that you want. For example if you only want to display the first 5, then you would have
<mvt:foreach.....
<mvt:if expr="pos1 LT 6">
stuff to display
</mvt:if>
</mvt:foreach>
It has been asked before to have a foreach stop but Miva has not yet added one.
Follow up question. Is there a way to exit the foreach loop after finding the entry I want that will allow the processing to continue in this header?
Can I set the foreach index to do this?
Hello forum: I'm processing a foreach loop, After I find the entry I want, I want to exit the loop without processing any more entries in the array. I'm trying to use the <mvt:exit> from within an <mvt:if conditional inside the foreach loop. This processing is being done in my page header area. Will the <mvt:exit> take me to the next Mima statement following my </mvt:foreach> or does it exit the entire page header?
Leave a comment: