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

How to display subcategories into multiple columns?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 07-16-2003, 06:15 PM
 
eachone eachone is offline
 

Newbie
  
Join Date: Feb 2003
Posts: 7
 

Default How to display subcategories into multiple columns?

How do I edit the subcategories.tpl in order to make it display in 3 or 4 columns and also with the icon or picture next to each subcategories? I am using V3.4.1

Original
Sub Cat 1
Sub Cat 2
Sub Cat 3
Sub Cat 4
Sub Cat 5
Sub Cat 6

Need to change to this:
Icon/S.Cat 1 Icon/S.Cat 2 Icon/S.Cat 3
Icon/S.Cat 4 Icon/S.Cat 5 Icon/S.Cat 5

Any help will be appreciate.
Reply With Quote
  #2  
Old 07-18-2003, 11:24 PM
 
funkydunk funkydunk is offline
 

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

Default

In subcategories.tpl

use the code:

Code:
{section name=cat_num loop=$subcategories} { if %cat_num.first% } <table border="0" cellspacing="0" cellpadding="5"> {/if} { if %cat_num.index% is div by 4} <tr> {/if} <td align="center"> <a href="home.php?cat={ $subcategories[cat_num].categoryid }"> [img]../icon.php?categoryid={$subcategories[cat_num].categoryid}[/img] { $subcategories[cat_num].category|escape }</a> </td> { if %cat_num.last% } </tr> </table> {/if} {/section}

This will also show the category icon there for you
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 07-20-2003, 04:20 AM
 
Xcart-Man Xcart-Man is offline
 

Advanced Member
  
Join Date: Jun 2003
Posts: 81
 

Default it also...

makes all your products disappear, and u go to a blank page when you click on those new links...
Reply With Quote
  #4  
Old 07-20-2003, 09:15 AM
 
funkydunk funkydunk is offline
 

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

Default

That isn't the whole code for subcategories.tpl just an excerpt to replace the top part where the subcategories are shown.
__________________
ex x-cart guru
Reply With Quote
  #5  
Old 07-21-2003, 10:41 PM
 
flytyme flytyme is offline
 

Member
  
Join Date: Feb 2003
Location: Dayton, OH, US
Posts: 22
 

Default

That really makes my site look better. Thanks.
__________________
Security is mostly a superstition. It does not exist in nature nor do the children of men as a whole experience it. Avoiding danger is no safer in the long run than outright exposure. Life is either a daring adventure or nothing. - Hellen Keller
Reply With Quote
  #6  
Old 07-22-2003, 02:42 PM
 
eachone eachone is offline
 

Newbie
  
Join Date: Feb 2003
Posts: 7
 

Default

Thanks, it works like Champ!! Ok sorry to ask for more. How do I change so the product list in 2 columns ? where to edit? I know it is roughly the same as the above code.

Thanks you the man!!
Reply With Quote
  #7  
Old 07-23-2003, 05:59 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

change this bit

Code:
{ if %cat_num.index% is div by 4}
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #8  
Old 07-23-2003, 05:47 PM
 
Xcart-Man Xcart-Man is offline
 

Advanced Member
  
Join Date: Jun 2003
Posts: 81
 

Default i never...

Quote:
Originally Posted by funkydunk
That isn't the whole code for subcategories.tpl just an excerpt to replace the top part where the subcategories are shown.

i never said i was smart.
Reply With Quote
  #9  
Old 07-23-2003, 06:03 PM
 
Xcart-Man Xcart-Man is offline
 

Advanced Member
  
Join Date: Jun 2003
Posts: 81
 

Default what....

Quote:
Originally Posted by shan
change this bit

Code:
{ if %cat_num.index% is div by 4}

What would I change it to, exactly?..i mean besides the obvious 4?...ugh
Reply With Quote
  #10  
Old 07-23-2003, 10:00 PM
 
funkydunk funkydunk is offline
 

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

Default

2 for two column
4 for four column
26 for twenty six column..... you get the idea
__________________
ex x-cart guru
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 10:39 AM.

   

 
X-Cart forums © 2001-2020