X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Subcategories in two columns (https://forum.x-cart.com/showthread.php?t=11680)

jeffcowt 01-24-2005 03:39 AM

Subcategories in two columns
 
Has the subcategories.tpl been changed for version 4.0.10? I would like a subcategory page to be divided up into at least two or three columns, preferably with a heading at the top of each column. Although there are posts for this on the forum, it seems the subcategories.tpl to modify has been changed. Am I just being thick? Please advise

My subcategories.tpl is:-


{* $Id: subcategories.tpl,v 1.43.2.5 2004/12/01 15:15:49 mclap Exp $ *}
{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}



{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}



{if $active_modules.Special_Offers}
{include file="modules/Special_Offers/customer/category_offers_short_list.tpl}
{/if}
{if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description|regex_replace: "/[\n]/":"
"}

{/if}
{capture name=dialog}
{assign var="tmp" value="0"}
{section name=cat_num loop=$subcategories}
{if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if}
{/section}
{if $subcategories}
{if $tmp} [img]{if $current_category.icon_url}{$current_category.icon _url}{else}{$xcart_web_dir}/icon.php?categoryid={$cat}{/if}[/img] {/if}
<TABLE border="0" cellspacing="5">
{foreach from=$subcategories item=subcat}
<TR>
<TD align="left" nowrap width="95%"><FONT class="ItemsList">{ $subcat.category|escape }</FONT>
</TD>
<TD align="right" nowrap><FONT class="Text">{if $config.Appearance.count_products eq "Y"}
{if $subcat.product_count}{ $subcat.product_count } {$lng.lbl_products}
{elseif $subcat.subcategory_count}{ $subcat.subcategory_count } {$lng.lbl_categories|lower}
{/if}
{/if}</FONT></TD>
</TR>
{/foreach}
</TABLE>
{/if}
{if $tmp and $products ne "" }
<BR clear="left">
<HR size="1" noshade>
{/if}
{if $products}
{if $sort_fields}
<DIV align="right">{include file="main/search_sort_by.tpl" sort_fields=$sort_fields selected=$search_prefilled.sort_field direction=$search_prefilled.sort_direction url="home.php?cat=`$cat`&"}</DIV>
{/if}
{if $total_pages gt 2}


{ include file="customer/main/navigation.tpl" }
{/if}
<HR size="1" width="100%">
{include file="customer/main/products.tpl" products=$products}
{/if}
{if $products eq "" and $tmp eq "0"}
{$lng.txt_no_products_in_cat}
{/if}
{/capture}
{include file="dialog.tpl" title=$current_category.category content=$smarty.capture.dialog extra="width=100%"}
{if $products eq ""}
{if $f_products ne ""}



{include file="customer/main/featured.tpl"}
{/if}
{/if}
{ include file="customer/main/navigation.tpl" }


Many thanks
(version 4.0.10?)

balinor 01-25-2005 05:20 PM

Yea, it is a bit different, but there is nothing wrong with using the old one. Or, just take a look at what they did in the old one and work it into the new one. Here's one I'm currently using in 4.0.10 that has 3 columns (note that the images are commented out):

Code:

{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}



{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}



{if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description|regex_replace:"/[\n]/":"
"}

{/if}
{capture name=dialog}
{assign var="tmp" value="0"}
{section name=cat_num loop=$subcategories}
{if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if}
{/section}

{section name=cat_num loop=$subcategories}
{ if %cat_num.first% }
<table width="100%" border="0" align="center" cellpadding="15" cellspacing="0">
{/if}
{ if %cat_num.index% is div by 3}
<tr>
{/if}
<td align="center" valign="top" width="33%">
{*<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
[img]{$xcart_web_dir}/icon.php?categoryid={$subcategories[cat_num].categoryid}[/img]</a>

*}
<a href="home.php?cat={ $subcategories[cat_num].categoryid }" class="ProductTitle">
{ $subcategories[cat_num].category|escape }</a>

{ $subcategories[cat_num].description|escape }
{if $config.Appearance.count_products eq "Y"}
{if $subcategories[cat_num].product_count}

({ $subcategories[cat_num].product_count } Products)
{elseif $subcategories[cat_num].subcategory_count}
({ $subcategories[cat_num].subcategory_count } Subcategories)
{/if}
{/if}
</td>
{ if %cat_num.last% }
</tr>
</table>
{/if}
{/section}

{if $tmp and $products ne "" }
<BR clear="left">
<HR size="1" noshade>
{/if}
{if $products}
{if $sort_fields}
<DIV align="right">{include file="main/search_sort_by.tpl" sort_fields=$sort_fields selected=$search_prefilled.sort_field direction=$search_prefilled.sort_direction url="home.php?cat=`$cat`&"}</DIV>
{/if}
{if $total_pages gt 2}


{ include file="customer/main/navigation.tpl" }
{/if}
<HR size="1" width="100%">
{include file="customer/main/products.tpl" products=$products}
{/if}
{if $products eq "" and $tmp eq "0"}
{$lng.txt_no_products_in_man}
{/if}
{/capture}
{include file="dialog.tpl" title=$current_category.category content=$smarty.capture.dialog extra="width=100%"}
{if $products eq ""}
{if $f_products ne ""}



{include file="customer/main/featured.tpl"}
{/if}
{/if}
{ include file="customer/main/navigation.tpl" }


jeffcowt 01-28-2005 03:32 AM

Thanks so much. That worked great. Do you know by any chance how to put a heading at the top of each column?
Thanks anyway for replying

balinor 01-28-2005 04:16 AM

What kind of heading?

jeffcowt 01-31-2005 04:24 AM

I would like to have the subcategory page from a particular manufacturer, then within that subcategory page a layout as follows:-

ModType 1 ModType 2

Model 1 Model 10
Model 2 Model 11
Model 3 Model 12
Etc. Etc.

Obviously with space between each column.

Thanks again for your help
(I have just patched up tp 4.0.11)


All times are GMT -8. The time now is 09:31 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.