How do I use an IF statement in a loop with StringTemplate

.net, c#, stringtemplate, templating-engine

Solution

you need to compute all expressions and push into the template. You are clearly filtering, which shoul be done in the model not the view. Please see:

http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf

Terence

Problem

This displays nothing: $Articles:{ $if(i!=1)$ display in between articles $endif$ $it.Text } This displays as expected $Articles:{ display in between articles $it.Text } Any ideas on how to get this working?

Original source