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

How do i only show certain categories in menus

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-30-2007, 07:02 AM
 
qrichou qrichou is offline
 

Advanced Member
  
Join Date: Oct 2007
Posts: 39
 

Default 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
Reply With Quote
  #2  
Old 01-25-2008, 09:48 AM
  SpinyMan's Avatar 
SpinyMan SpinyMan is offline
 

Advanced Member
  
Join Date: Jan 2008
Posts: 30
 

Default Re: How do i only show certain categories in menus

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 )
Attached Files
File Type: tpl categories.tpl (1.0 KB, 87 views)
__________________
Regards,
SpinyMan

X-Cart Templates Store -
http://www.x-cart-customization.com/shop/

X-Cart Customization Services -
http://www.x-cart-customization.com/
Reply With Quote
  #3  
Old 01-29-2008, 01:41 AM
 
qrichou qrichou is offline
 

Advanced Member
  
Join Date: Oct 2007
Posts: 39
 

Default Re: How do i only show certain categories in menus

Hi SpinyMan,

Many thanks i will give it a try

Richie
Reply With Quote
  #4  
Old 01-31-2008, 08:36 AM
 
nidea nidea is offline
 

Newbie
  
Join Date: Apr 2007
Posts: 7
 

Default Re: How do i only show certain categories in menus

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.
Attached Files
File Type: tpl categories.tpl (2.2 KB, 73 views)
__________________
Version 4.1.6
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 03:28 PM.

   

 
X-Cart forums © 2001-2020