Sometimes you want to list each item in the collection with a separator in between like a comma or slash. However the trick is to have the separator only in between items.
In ATG DSP you can use the ForEach droplet to iterate through each item in a collection. However to put a separator between each item is not straight-forward with this droplet. To do this I used JSTL to test if we are at the end of the collection. If we are then I don’t add the separator, otherwise I do.
Here is an example.
And here is the output for this example.
The Incredibles, Ratatouille, Cars
Do you have a better or more elegant solution? Please feel free to let me know in the comments?