Posted on 23/02/2012 14:07:55
I'm working on a solution, in which I wish to style the first item in a news list differently than the rest. My idea was, to validate in NewsList.LoopCounter=1, and then do whatever I wish to do. However, it seems Dw ignores this, and enters the loop regardless of the LoopCounter.
For example:
<!--@LoopStart(NewsList)-->
<!--@If(NewsList.LoopCounter=1)-->
<!--@NewsList.LoopCounter-->
<!--@EndIf-->
<!--@LoopEnd(NewsList)-->
I would expect this to return the value "1" for the first item, but instead it will print out the current loopcounter for each item, regardless if it's equal to 1 or not: "1 2 3 4 ... etc."
The strange thing, is that it works fine other places — just not here, for some odd reason. Any ideas? Is there a different way to go about this, without having to surrender to XSLT?