Developer forum

Forum » Templates » Newslist loopcounters

Newslist loopcounters

Nikki Strømsnes
Reply
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?

Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer
I just tested - and it works.

What version of DW? Remember that this is a only 1 year old feature.

Votes for this answer: 0
 
Nikki Strømsnes
Reply
That explains. This solution is from ancient times past. So the only way to do this is with XSLT. :(
 
Nicolai Høeg Pedersen
Reply
Upgrade!!!

 

You must be logged in to post in the forum