Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fetch the "Alias" field for Joomla menu item

Tags:

php

joomla

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.

like image 472
Alex Avatar asked Mar 08 '11 18:03

Alex


1 Answers

$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
like image 189
Gaurav Avatar answered Sep 18 '22 10:09

Gaurav