S
S
smoky-jo2019-10-14 12:45:10
PHP
smoky-jo, 2019-10-14 12:45:10

How to display a smarti cycle in 4 columns?

Hello, tell me how to display this code in 4 columns?

{foreach name="master_loc" from=$bl_locations.values item=v}
{if $smarty.foreach.master_loc.index % 4 == 0}
<input id="lt{$v.id}" type="radio" name="bl_tabs" class="tradio" {if $smarty.foreach.master_loc.index==0}checked{/if}>
<label for="lt{$v.id}" id="bl_label{$v.id}">{$v.name|replace:" ":"&nbsp;"}</label>
{/if}
    {/foreach}

I tried different things, it doesn't work, it's the only way
{if $smarty.foreach.master_loc.index % 4 == 0}<hr/>{/if}

but i need li
{foreach name="master_loc" from=$bl_locations.values item=v key=k}
{if $smarty.foreach.master_loc.index % 4 == 0}
<li>
    <input id="lt{$v.id}" type="radio" name="bl_tabs" class="tradio" {if $smarty.foreach.master_loc.index==0}checked{/if}>
    <label for="lt{$v.id}" id="bl_label{$v.id}">{$v.name|replace:" ":"&nbsp;"}</label>
    </li>
{/if}
{if $k%4 == 0}</ul><ul>{/if} 
    {/foreach}

that didn't work either..

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question