I am trying to feed a slider two rows of data before going on to the next list item, and I am having some trouble.
This post indicates that I should do something with a key to advance it on: Next item in foreach SMARTY
{foreach item=job from=$hot_jobs key=i}
<li>
<div class="job">
{$job.title}
<span>{$job.type}</span>
</div>
<!-- trying to do the same div twice basically -->
<div class="job">
{$job[{$i+1}].title}
<span>{$job[{$i+1}].type}</span>
</div>
</li>
{/foreach}
A nudge in the right direction would be really appreciated!
alright found a simple solution!
added name='hotLoop' to foreach
{if $smarty.foreach.hotLoop.first}
<li>
{/if}
div stuff in the middle
{if $smarty.foreach.hotLoop.iteration is div by 2}
</li>
<li>
{/if}
{if $smarty.foreach.hotLoop.last}
</li>
{/if}
this allowed me to have two sets of inside of an LI so my slider would function. no need to mess with arrays and such with the built in smarty features of the foreach.