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)
-   -   How do i only show certain categories in menus (https://forum.x-cart.com/showthread.php?t=35816)

qrichou 11-30-2007 07:02 AM

How do i only show certain categories in menus
 
Hi All,

I have been searching the forums for a solution to this and I have tried a few ideas to implement what I am trying to achieve but I cant get it to work.

I don▓t want the root categories to show in the left menu or the top menu only the sub cats.

Basically we have our categories set out as below

Top menu (root)
cat1
cat2
cat3
cat4

Left menu (root)
cat1
cat2
cat3
cat4

I thought i could use the parent id in the categories.tpl to get the sub cats to show :
{if $allcategories[subcat].parentid eq 340} but this doesn▓t work.

Any help would be greatly appreciated.

Many Thanks

Richie

SpinyMan 01-25-2008 09:48 AM

Re: How do i only show certain categories in menus
 
1 Attachment(s)
Quote:

Originally Posted by qrichou
I have been searching the forums for a solution to this and I have tried a few ideas to implement what I am trying to achieve but I cant get it to work.

I don’t want the root categories to show in the left menu or the top menu only the sub cats.

Basically we have our categories set out as below

Top menu (root)
cat1
cat2
cat3
cat4

Left menu (root)
cat1
cat2
cat3
cat4

I thought i could use the parent id in the categories.tpl to get the sub cats to show :
{if $allcategories[subcat].parentid eq 340} but this doesn’t work.


Hi,
see attached file. Hope it will helps u.
NOTE: it works ONLY with one-leveled subcategories (if need more I will be here :wink:)

qrichou 01-29-2008 01:41 AM

Re: How do i only show certain categories in menus
 
Hi SpinyMan,

Many thanks i will give it a try :)

Richie

nidea 01-31-2008 08:36 AM

Re: How do i only show certain categories in menus
 
1 Attachment(s)
SpinyMan,

Thank you so much! You are a life saver. Based on that, I was FINALLY able to create the "always display all categories and all their subcategories" layout I was so searching for!

Code:

Main Cat A
  subcat 1
  subcat 2
  subcat 3
Main Cat B
Main Cat C
  subcat 1
  subcat 2
  subcat 3



My categories.tpl, based on yours, is attached for others.


All times are GMT -8. The time now is 06:40 PM.

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