in reply to help me with template module to print like this
So if I'm understanding you correctly, you want to use "or" as a separator before the last entry in the list if the list is longer than 2, and "," otherwise.
The loop iterator supports several methods like .last(), .size(), .count() etc., so you could for example test .last() (which returns true if the current iteration is the last) to determine whether to insert "or" or ","...
See also Loop Processing.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: help me with template module to print like this
by veerubiji (Sexton) on Nov 09, 2011 at 21:37 UTC | |
by Eliya (Vicar) on Nov 09, 2011 at 23:01 UTC | |
by veerubiji (Sexton) on Nov 10, 2011 at 08:25 UTC |