We have this code which find events on our website within certain date parameters and we only want to display 10 events. The problem is if an event doesn't meet the date parameters the position counter still increments.
Therefore we only get 4 or so events displaying as the position reaches 10 irrespective of the if tests.
Help with loop
Hi guys,
We have this code which find events on our website within certain date parameters and we only want to display 10 events. The problem is if an event doesn't meet the date parameters the position counter still increments.
Therefore we only get 4 or so events displaying as the position reaches 10 irrespective of the if tests.
Can you help with a way to achieve this?
Thanks
I think you'd need to move more of your conditions into the for-each in order to use position() in this way. Something like (totally untested!)
Dan
Perfect - thank you!
is working on a reply...