Developer forum

Forum » Feature requests » loop last item

loop last item

Nuno Aguiar
Reply
Hi,

Would be nice to have a tag stating it's the last item in the loop

I know we already have the footerEnd, but we wanted to have a loop of Names and render it like:

Nuno, Ricardo, Marco, Pedro, António and Diogo

With if statements, I can check the LoopCounter and only place the ',' if it's not the first one, but for the last one I can't, because I never know the loop length

Nuno


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer
Hi Nuno

Great suggestion - but because of the way the loop engine works, this is only possible when using XSLT templates.

Votes for this answer: 0
 
Nuno Aguiar
Reply
Hi Nicolai,

Yes, the way loops work is not friendly to that extend, but you could add a tag with the loop lenght on the template root level, and then with the new GetMaster tag, we could match the loopCounter against it.

Well that would maybe imply if statements to compare tags :P

Nuno