cycle function

This isn't Exponent specific, but if you haven't visited the Smarty Docs yet, you should really know about it. Here's a sample piece of code:

{foreach name=items from=$items item=item}          
   <div class="item {cycle values="column-left,column-right"}">
     <div class="bodycopy">{$item->body}</div>   

The "cycle values" expression lets you tell Exponent, through the Templating Engine, to output alternating values for your div classes in this case. This can be used with table rows and other HTML.

Loading Help