X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   How to display subcategories into multiple columns? (https://forum.x-cart.com/showthread.php?t=3633)

eachone 07-16-2003 06:15 PM

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.

funkydunk 07-18-2003 11:24 PM

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 :D

Xcart-Man 07-20-2003 04:20 AM

it also...
 
makes all your products disappear, and u go to a blank page when you click on those new links...

funkydunk 07-20-2003 09:15 AM

That isn't the whole code for subcategories.tpl just an excerpt to replace the top part where the subcategories are shown.

flytyme 07-21-2003 10:41 PM

That really makes my site look better. Thanks. :D

eachone 07-22-2003 02:42 PM

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

shan 07-23-2003 05:59 AM

change this bit

Code:

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

Xcart-Man 07-23-2003 05:47 PM

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. :oops:

Xcart-Man 07-23-2003 06:03 PM

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

funkydunk 07-23-2003 10:00 PM

2 for two column
4 for four column
26 for twenty six column..... you get the idea :wink:


All times are GMT -8. The time now is 01:26 PM.

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