Smarty Template help

Permabanned
Joined
25 Oct 2004
Posts
9,078
Hiya,

Anyone familiar with smarty templates, im fairly new to it all and im trying to modify a template which lists categories.

At the moment the template just lists the categories in one large column, but i would like to split it up over 3 columns, limiting the number of entries to each column.

This is the code i have currently which lists them all in one column. How would I go about listing them across 3 columns, for example limiting each column to only 5 rows.

Code:
<table cellpadding="2" cellspacing="1" style="border-style: none; width: 100%;">

    {foreach from=$link_url key=id item=url}

        {if $open_col.$id eq 1}
            <tr>
        {/if}

        <td style="width:{$column_width}">

            {if $image.$id}
                <a href="{$url}" class='main_navigation_1_name'><img src='{$image.$id}' style="margin: 0px 2px; border-style: none; float: left;"></a>
            {/if}

            <a href="{$url}" class='main_navigation_1_name'>{$categories_name2.$id}</a>

            {* these display inline with the category name, but put them on their own lines for code-readability *}
            {$categories_display_count.$id}
            {if $new_icon.$id}{$new_icon.$id}{/if}
            
             
             {if $description.$id}<br /><span class="class_navigation_1_description">{$description.$id|fromDB}</span>{/if}
             {if $sub_categories_tpl.$id}<br />{$sub_categories_tpl.$id}{/if}
         </td>
        
        {if $close_col.$id eq 1}
            </tr>
        {/if}
    {/foreach}
    
</table>

Any help much appreciated
 
Back
Top Bottom