Skip to content

Instantly share code, notes, and snippets.

@makbeta
Created November 30, 2012 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makbeta/4173302 to your computer and use it in GitHub Desktop.
Save makbeta/4173302 to your computer and use it in GitHub Desktop.
Luminate CMS: Assign classes .first & .last to first & last items in the list
<t:if test="length > 0">
<ul><t:list>
<t:set id="myClass" value="''" />
<t:if test="index == 1"><t:set id="myClass" value="'first'" /></t:if>
<t:if test="index == length"><t:set id="myClass" value="concat(myClass, ' last')" /></t:if>
<t:set id="myClass" value="trim(myClass)" />
<t:if test="!isNull(myClass)"><li class="${myClass}"></t:if>
<t:else><li></t:else>
<a href="${url}">${title}</a><p>${description}</p>
</li>
</t:list></ul>
</t:if>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment