Custom Menu

[color=#282828][font=arial, verdana, tahoma, sans-serif]Hello Guys,[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]I have a custom menu ( ul li menu )[/font][/color]





[color=#282828][font=arial, verdana, tahoma, sans-serif]Books | Food | Electronics | Home Made | Other[/font][/color]





[color=#282828][font=arial, verdana, tahoma, sans-serif]and I have my Categories[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]Books[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]------------>C++[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]------------>C[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]-------------------Product1[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]-------------------Product2[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]-------------------Product3[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]------------>Java[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]Food[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]------------->Dry Food[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]------------->Soda[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]------------->Rice[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]-------------------Product1[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]-------------------product2[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]------------->Deli[/font][/color]





[color=#282828][font=arial, verdana, tahoma, sans-serif]The problem is When some one click the link Books I need the menu color to change it to green[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]if they click on C or C++ ( any subcategory under Books must remain green)[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]if you click any product under Books( including the sub category the link must remain green[/font][/color]





[color=#282828][font=arial, verdana, tahoma, sans-serif]i use this method[/font][/color]




```php


    {if $category_data.category_id == 1 || $category_data.category_id == 20 }
  • Books

  • {/if}

```




[color=#282828][font=arial, verdana, tahoma, sans-serif]but the problem is category_id(Books) once i click the subcategory it no longer work or even if I click on a product[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]I just want different color for each menu item(main category), because I have so many categories[/font][/color]