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)
-   -   Breakup Subcategories (https://forum.x-cart.com/showthread.php?t=1712)

SC 03-03-2003 01:32 PM

Breakup Subcategories
 
How can I separate subcategories into multiple columns? IБ─≥ve searched the forum and found a few related topics but none seem to work??? Any help is greatly appreciated!

B00MER 03-03-2003 10:30 PM

You are wanting the sub category listings to be in 2 or 3 columns correct?

SC 03-04-2003 07:02 AM

Correct, I am wanting the sub category listings to be in 2 columns.

funkydunk 03-04-2003 07:16 AM

Try something like for a two column list in subcategories.tpl:

Code:

{section name=cat_num loop=$subcategories}
{ if %cat_num.first% }
<table border=0 cellspacing=0 cellpadding=0 width="100%">
<tr>
<td align=center>
<table border=0 cellspacing=2 cellpadding=2>
<tr>
{/if}

<td width=80 height=22>{ $subcategories[cat_num].category|escape }
</td>
{if $smarty.section.cat_num.index is odd}
</tr>
<tr>
{/if}

{ if %cat_num.last% }
</tr>
</table>
</td>
</tr></table>
{/if}
{/section}


cao 06-06-2003 08:02 AM

Hello,

Thanks for posting the code it pointed me in the right direction, but I am trying to split them into 3 or 4 columns.

I tried using the {if $smarty.section.cat_num.index is div by 3} but since the index starts with a 0 and 0 is divisible by 3 it inserts <tr></tr> after the first category, so the table looks like this

cat0
cat1 cat2 cat3
cat4 cat5 cat6
cat7 cat8 etc.

I would realy appreciate any help.

Thanks

Beaker 12-06-2004 02:18 PM

multiple columbs in version 4 xcart
 
have you ever changed this in the version 4 xcart? the code is set up a bit different. I was able to use this code in the last store I used but the new version subcategories.ypl has this code instead:

{section name=cat_num loop=$subcategories}
{if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if}
{/section}
{if $subcategories}
<TABLE border="0" cellspacing="5">
{foreach from=$subcategories item=subcat}
<TR>
<TD align="center" nowrap width="95%">
[img]{$xcart_web_dir}/icon.php?categoryid={$subcat.categoryid}[/img]

<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}

balinor 12-06-2004 02:22 PM

http://forum.x-cart.com/viewtopic.php?t=5131&highlight=subcategories


All times are GMT -8. The time now is 11:44 AM.

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