views:

289

answers:

2

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?

A: 

here, it says that $if tests for the presence of an attribute or evaluates a boolean expr. The only operator allowed is !(NOT),
so maybe you can define a boolean variable = (i!=1) and use it in the $if statement.

najmeddine
yeah I saw that, don't know how I can create a boolean value within a loop as a global one would be no use to me.The i value represents the current iteration.
Stephen lacy
+2  A: 

Hi. 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

Terence Parr