Yep,.. it works

_day.vm

#set($dayNum = $velocityCount)
#foreach( $entry in $entries )
#if($dayNum ==1 && $velocityCount == 1)
<div id="first" class="post">
#else
<div class="post">
#end
..........

Thanks a lot

----- Original Message ----
From: Richard Jones <[EMAIL PROTECTED]>
To: [email protected]
Sent: Thursday, August 2, 2007 6:08:04 AM
Subject: Re: _day.vm template question

Hi Gene,

Not 100% sure if this will work, but when the _day template is parsed
you may be able to get the loop index using the built-in velocity
"$velocityCount" variable, see:

http://velocity.apache.org/engine/devel/user-guide.html#loops

HTH,

Richard


On 01/08/07, Evgeniy Strokin <[EMAIL PROTECTED]> wrote:
> Hello,
> Some times I need to know how many times _day.vm template was called already.
> Is any way to get this number?
> For example, I have a blog which has 5 days on the first page displayed. In 
> each day I have 2 posts.
> Let's say I need to display posts of the latest day (on the top) in diferent 
> color, and all others in other color.
> How can I do this?
>
> Thank you,
> Gene




Reply via email to