Alex
Alex

Reputation: 35881

Fetch the "Alias" field for Joomla menu item

Is there a way to get the Alias field of a main menu item in Joomla 1.5 from mod_mainmenu module? I know you can access the menu using this code:

$menu = JSite::getMenu();

I need to use the Alias field to hold a sub-title for the menu item. Is it possible to fetch this from the modMainMenuXMLCallback() function in mod_mainmenu? Thanks.

Upvotes: 6

Views: 5976

Answers (1)

Gaurav
Gaurav

Reputation: 28775

$menu = JSite::getMenu();
$alias = $menu->getItem($id)->alias;  // if you have id of menu


$menu = JSite::getMenu();
$alias = $menu->getActive()->alias;  // alias of active menu

Upvotes: 13

Related Questions