Help add extra 2 columns to tpl extension

Discussion in 'PHP' started by easy2sell, Mar 12, 2012.

  1. #1
    Hello all, sorry if I post in the wrong post:

    I am having a hard time fixing this problem. At the moment there are only 2 columns displaying root category with the sub category. Because there is a long list of sub category one have to scroll to the bottom page. So I need to add extra 2 columns to make it 4. This is the layout of the site.
    {include file='t_javascript_language.tpl'}{set_css}
    {set_js}
    
    
    <!--<div class="componentheading">{$page_title}</div>-->
    
    
    <div class="adds_man_list">
        <span>{$category_pathway}</span>
        {if $current_category->catname!=""}
        <div style="border:2px solid #000;">
            {include file='elements/display_fields.tpl' position='categoryicon' this_add=$current_category->id}
            
            <strong>{$current_category->catname}</strong>
            
            <div class="adds_subcat" style="text-align:right;background:#F5F5F5; border:1px solid #FFFFFF; " >
            
            {include file='elements/display_fields.tpl' position='categorydetails' this_add=$current_category->id}
            
            <span style="font-size:12px;">
            
            {jtext text="ADS_SUBCATEGORIES"}:   {$current_category->kids} {jtext text="ADS_ADS"}: {$current_category->nr_ads}
                <a href="{$current_category->view}" title="{jtext text='ADS_VIEW_LISTINGS'}">
                    <img src="{$IMAGE_ROOT}view_listings.gif" class="ads_noborder" alt="{jtext text='ADS_VIEW_LISTINGS'}" />
                </a>                    
            </span>
            </div>
        </div>
        {/if}    
        {if $categories|@count<=0}
            <h2>{jtext text="ADS_NO_CATEGORIES_DEFINED"}</h2>
        {/if}
        <table id="adds_categories" class="ads_table">
        {section name=category loop=$categories}
        {if $smarty.section.category.rownum is odd}
        
        {/if}
                <td width="50%" class="adsman_catcell"valign="top">
                    <div class="adds_maincat" {if $categories[category]->watchListed_flag}class="cat_watchlist"{/if}> 
                        
                        {include file='elements/display_fields.tpl' position='categoryicon' this_add=$categories[category]->id}
                        <a href="{if $categories[category]->kids>0}{$categories[category]->link}{else}{$categories[category]->view}{/if}" >
                            {$categories[category]->catname}
                        </a>
                        {if $categories[category]->is_new}
                            <!--NEW!!-->
                            <img src="{$IMAGE_ROOT}new.png" alt="new ads" />
                        {/if}
                        <a href="{$categories[category]->view}" title="{jtext text='ADS_VIEW_LISTINGS'}">
                            <img src="{$IMAGE_ROOT}view_listings.gif" class="ads_noborder" alt="{jtext text='ADS_VIEW_LISTINGS'}" />
                        </a>                    
                        {if $is_logged_in}
                            {if $categories[category]->watchListed_flag}
                                <img src="{$IMAGE_ROOT}watchlist.png" width="16"class="ads_noborder" />
                            {/if}
                            <a href="{$categories[category]->link_watchlist}">
                                <img src="{$categories[category]->img_src_watchlist}" width="16" class="ads_noborder" title="{if $categories[category]->watchListed_flag}{jtext text='ADS_REMOVE_FROM_WATCHLIST'}{else}{jtext text='ADS_ADD_TO_WATCHLIST'}{/if}"/>
                            </a>
                        {/if}
                        <br />
                    </div>
                    
                    <div class="adds_subcat" style="background:#F5F5F5; border:1px solid #FFFFFF; " >
                    {include file='elements/display_fields.tpl' position='categorydetails' this_add=$categories[category]->id}
                    <br />
                    
                    {section name=subcategory loop=$categories[category]->subcategories}
                    
                        {include file='elements/display_fields.tpl' position='categoryicon' this_add=$categories[category]->subcategories[subcategory]->id}
                        <a href="{if $categories[category]->subcategories[subcategory]->kids>0}{$categories[category]->subcategories[subcategory]->link}{else}{$categories[category]->subcategories[subcategory]->view}{/if}">{$categories[category]->subcategories[subcategory]->catname}</a> 
                        {if $categories[category]->subcategories[subcategory]->is_new==1}
                            <img src="{$IMAGE_ROOT}new.png" alt="new ads" />
                          {/if}
                            ({$categories[category]->subcategories[subcategory]->nr_a} {jtext text="ADS_ADS"})
                        {if $categories[category]->subcategories[subcategory]->watchListed_flag}
                            <img src="{$IMAGE_ROOT}watchlist.png" width="16" class="ads_noborder" />
                        {/if}
                        {if $is_logged_in}
                        <a href="{$categories[category]->subcategories[subcategory]->link_watchlist}">
                            <img src="{$categories[category]->subcategories[subcategory]->img_src_watchlist}" width="14" class="ads_noborder" title="{if $categories[category]->subcategories[subcategory]->watchListed_flag}{jtext text='ADS_REMOVE_FROM_WATCHLIST'}{else}{jtext text='ADS_ADD_TO_WATCHLIST'}{/if}"/>
                        </a>
                        {/if}
                        <br />
                        <p style="margin-left:25px;">
                        {include file='elements/display_fields.tpl' position='categorydetails' this_add=$categories[category]->id}
                        </p>
                    {/section}
                    </div>
                </td>
            {if $smarty.section.category.rownum is not odd}
            </tr>
            {/if}
        {/section}
        </table>
    </div>
    
    
    
    Code (markup):
    Thank you in advance for your help
     
    easy2sell, Mar 12, 2012 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,899
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #2
    sarahk, Mar 12, 2012 IP
  3. easy2sell

    easy2sell Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you so much for your time and response.I have tried to replace {section name=category loop=$categories} with
    {html_table loop=$data cols="first,second,third,fourth" tr_attr=$tr} but throws error at me. Any help on how I can implement the code will be very helpful. my website is (tt(dot)easy2sell(dot)net you can have a look of what the code is doing.
    Many thanks again for your time.
     
    Last edited: Mar 12, 2012
    easy2sell, Mar 12, 2012 IP