Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Breakup Subcategories

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-03-2003, 01:32 PM
 
SC SC is offline
 

Newbie
  
Join Date: Jan 2003
Posts: 9
 

Default 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!
Reply With Quote
  #2  
Old 03-03-2003, 10:30 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

You are wanting the sub category listings to be in 2 or 3 columns correct?
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #3  
Old 03-04-2003, 07:02 AM
 
SC SC is offline
 

Newbie
  
Join Date: Jan 2003
Posts: 9
 

Default

Correct, I am wanting the sub category listings to be in 2 columns.
Reply With Quote
  #4  
Old 03-04-2003, 07:16 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

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}
__________________
ex x-cart guru
Reply With Quote
  #5  
Old 06-06-2003, 08:02 AM
 
cao cao is offline
 

Member
  
Join Date: May 2003
Location: Chicago IL
Posts: 8
 

Default

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
Reply With Quote
  #6  
Old 12-06-2004, 02:18 PM
 
Beaker Beaker is offline
 

Newbie
  
Join Date: May 2004
Posts: 9
 

Default 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}
Reply With Quote
  #7  
Old 12-06-2004, 02:22 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

http://forum.x-cart.com/viewtopic.php?t=5131&highlight=subcategories
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020