Search code examples
menujoomlamenuitemmenubarjoomla1.6

Joomla: How to keep main menu item highlighted while navigating through separate submenu items?


I'm trying to make a horizontal, "category" main menu and a vertical submenu, separated from the main one. When I select a category its main page is displayed. But when I select another page from the submenu, that is supposed to be from the same category, then the "category" item from main menu stops being highlighted. All the menus are defined as a "stand-alone" modules and I'm using Joomla 1.6.3.


Solution

  • What I didn't know at the time was that I should set each item in the top menu as a Menu Item Alias. This allowed me to keep the item highlighted when items were selected from the submenu.

    According to Joomla documentation http://docs.joomla.org/Help16:Menus_Menu_Item_Manager_Edit#Menu_Item_Alias:

    "This Menu Item Type creates a Link to an existing Menu Item. It allows you to have identical Menu Items on two or more different Menus without duplicating the settings. So, for example, if you change a parameter of a Menu Item that has an Alias linked to it, the Alias will automatically acquire the same change."

    For those who, like me before, are struggling with the idea of Joomla menus - the main menu in such configuration sits in a "Module Menu" with Start and End Level set to 1 (Basic Options), and the submenu sits in a different "Module", but carries the same menu, buts starts from Level 2.