View Single Post
  #1  
Old 03-14-2007, 03:57 PM
 
pdheady pdheady is offline
 

Advanced Member
  
Join Date: Mar 2007
Location: West Palm Beach, FL
Posts: 36
 

Default Need simpler function for cat id conditions...

I'll keep it simple, Im building a custom menu that consists of a main menu and a submenu. The mainmenu and submenus are called if any category id condition is met as in the example below.

<?
if ($cat == 1 || $cat == 2 || $cat == 3 || $cat == 4 || $cat == 5 ) {
$menu = "dothismenu"; }

if ($cat == 3 || $cat == 4 ) { $submenu = "dothatmenu"; }

{/if}
{/if}

?>


Now I have hundreds of categories and I would rather find some better logic then to write all category id's illustrated above. It is very time consuming, and the other caveat is I have to manually go into the backend and update everytime a new category is added.

Is there a simpler way of performing this task, such as a smarty function or command to get the root level id, and 2nd level id based on the current catid?
__________________
Xcart 4.0.19
Reply With Quote