Add "firstli and lastli" classes to list

Add "firstli and lastli" classes to list

Saturday 26 September 2009 10:51:33 am - 2 replies

Author Message

Steven E. Bailey

Sunday 27 September 2009 12:29:12 am

This is how I do it - something like this:

<ul>
{foreach $item_list as $index => $item}
	<li class="{cond(eq($index,0),'firstli',eq($index,dec($item_list_count)),'lastli','normalli')}">This is {$index} for {$item}</li>
{/foreach}
</ul>

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

DeAndre Johnson

Sunday 27 September 2009 9:02:12 pm

Thanks. That worked as needed.

I am, because I choose to be!

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.