Count a #foreach cycle

16 views
Skip to first unread message

Giulio Fior

unread,
Aug 1, 2013, 7:49:20 AM8/1/13
to ent...@googlegroups.com
Hi

I'm trying to create a model for a photogallery in which every item has a unique id, but seems that the velocity engine is lacking sometings.

My code should be like this 

<ul>
#foreach ($image in $content.ImageZoom)
<li><img src="$image.getImagePath("0")" id="item_$foreach.count" /></li>
#end
</ul>

The velocity code seems correct but it doesn't work.

Any idea?

Thanks

Lela

unread,
Aug 1, 2013, 8:17:29 AM8/1/13
to ent...@googlegroups.com
Try $velocityCount instead $foreach.count

Giulio Fior

unread,
Aug 1, 2013, 11:37:32 AM8/1/13
to ent...@googlegroups.com
Great!, it works

Thanks a lot
Reply all
Reply to author
Forward
0 new messages