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

IF then question about root level categories

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-30-2009, 07:06 AM
  inkcarts's Avatar 
inkcarts inkcarts is offline
 

Advanced Member
  
Join Date: Sep 2008
Location: Crowley Louisiana
Posts: 45
 

Default IF then question about root level categories

Is there a way to determine what Root Level category that a sub category is under.

What i'm trying to do is a tabbed navigation. If the category page you are is under a certain root category, then highlight a certain tab.

is there such a thing as

If
category = x
then
style="current"

Thanks in advance for your help.
Lyn
__________________
Lyn Askin
X-Cart 4.2.3
MICR Toner
Toner Cartridges
X-Cart Search Engine Optimization
Reply With Quote
  #2  
Old 03-30-2009, 11:45 AM
 
Will Hayes Will Hayes is offline
 

eXpert
  
Join Date: Apr 2007
Location: Waterford, Ireland
Posts: 206
 

Wink Re: IF then question about root level categories

You could try

{$cat}

This variable contains the parent category id of the current category or product page you might be viewing.

For example, you could loop through your standard category array
$categories

and perform a check for a match like this:

Code:
{foreach from=$categories item=c} <li class="color-{$c.order_by}"><a {if $cat == $c.categoryid}class="active"{/if} href="home.php?cat={$c.categoryid}">{$c.category}</a></li> {/foreach}

Notice the if statement within the a tag.

Hope that helps you somewhat.

regards
W.
__________________
The xCart Store.com - Professional x-cart modules and x-cart templates
xMenus, Predictive Search, xBanners2, Busy Kitchen, xtreme Gear, Modern Living, xMobile - Smartphone template & Responsive x-cart template

x-cart 3.x.x
x-cart 4.x.x
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 05:35 AM.

   

 
X-Cart forums © 2001-2020