/ Published in: Smarty
Take array and create multiple columns, define divisible by value ($divis) from total results then use modulus within the loop. This example shows multiple columns for unordered list items.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<div class="bullet-text"> Divided by 3: {{$divis}} <ul class="col"> {{section name=i loop=$results}} <li> <strong><a href="/search/{{$results[i]|urlencode}}">{{$results[i]|validate}}</a></strong> </li> {{if $smarty.section.i.iteration % $divis == 0}} </ul><ul class="col"> {{/if}} {{/section}} </ul> </div>