While working on a Joomla website, I realized that if you have an external URL type menu item in your Joomla site then most likely active menu highlighting won’t work for it. Active menu highlighting basically means that the current menu selection is highlighted as a visual clue to show the website user which menu is currently selected. In the example below, currently menu item 2 is shown as selected.
Joomla allows you to create various type of menu items for it’s core features (e.g. articles, category, weblinks, users etc) and third party components. It also allows you to link to external web pages and internal pages by providing the direct URL (shown below). Though the type is external URL, you can actually use it to create menu links to internal pages of your Joomla site as well.
Once you create an external URL type menu and publish it, it starts showing up in selected menu. However the problem which I faced was that it wasn’t getting highlighted when I selected/clicked on this menu item. Active menu highlighting usually works out of the box with default and third party templates. Tried a few things and even considered hard-coding the CSS but finally decided not to do that.
After exploring other menu types under system links, I came across menu item alias type. As the name suggests, you can create a link to another menu item using it. I created an alias to the menu item for which active menu highlighting wasn’t working and bingo … it started working miraculously!! But then a new problem came up. Now there were two menu items pointing to same page. Disabling the original menu is not a solution since that would make the menu alias stale.
Workaround of this problem is to create a new menu (not new menu item but a new menu). I created a new menu and named it Hidden (you can name it anything you like). Under this menu, I added external URL type menu which I needed. Now in my original menu, I added a menu alias for the external URL menu item I just created under Hidden menu. Make sure both menu items are published. That’s all and everything started working perfectly.
If you have more than one such menu then add them under the same Hidden menu and create menu alias for each one of them in the menu which is being used.