Michael Lamberton wrote:
Hi roller user list,
Due to a picky client, I need to have tags separated by commas. I have some code written already, but because of a bug in the velocity engine, the $velocityHasNext variable isn't working in a nested foreach loop. Is there a way to update the velocity engine in roller with the latest version?
Thanks,
Mike

In principle yes, but you might run into compatibility issues and the need to upgrade other dependencies if you do that. An uglier alternative that might work for you is to get the size of the list/collection using $theCollection.size() prior to the loop, store it in a variable, and then count and use a conditional within the loop to decide whether to place the comma or not.

I think there are some examples of using .size() (though not in this way) in the stock macros in weblog.vm if you poke around .

--a.

Reply via email to