View Single Post
  #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