Code: Select all
<div class="NewsSummary Left">
...
</div>
<div class="NewsSummary Right">
...
</div>
<div class="NewsSummary Left">
...
</div>
and so on...
Code: Select all
<div class="NewsSummary Left">
...
</div>
<div class="NewsSummary Right">
...
</div>
<div class="NewsSummary Left">
...
</div>
and so on...
Thanks for the tip! But if you or someone else has already solution (maybe example code?) I would save a lot of time 'cause I'm not pro with smarty coding...Jos wrote:You might want to check example 7.10 on this page: http://www.smarty.net/docsv2/en/languag ... oreach.tpl
Code: Select all
{foreach from=$items item=entry name=newsentry}
<div class="NewsSummary {if $smarty.foreach.newsentry.index % 2 == 0}Left{else}Right{/if}">
</div>
{/foreach}
Code: Select all
{foreach from=$items item=entry}
{cycle values='row1,row2' assign='currow'}
<div class="NewsSummary {$currow}">
Where is the plus 1 buttonJos wrote:ah yes, cycle is also a nice function for this... forgot how simple things can be sometimes
pcfcopies wrote:Where is the plus 1 button