Joomla changing menu from Component
- by Bobz
My component is always shown on the Default menu,
I want to be able to change the menu from my component.
I have found that:
$currentMenuId = JSite::getMenu()-getActive()-id ;
Returns the current active Menu item
However,
$menu-setActive( $menuitemid );
Does not do anything,
Whether I use,
$app = JFactory::getApplication(); $menu = $app-getMenu();
$menu-setActive( $menuitemid );
or,
$menu = JSite::getMenu(); $menu-setActive( $menuitemid );
How can I change the menu?
As I do not want it to always be shown on the default menu.