[英]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? 有没有办法从mod_mainmenu模块获取Joomla 1.5中主菜单项的Alias字段? 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. 我需要使用Alias字段来保存菜单项的子标题。 Is it possible to fetch this from the modMainMenuXMLCallback()
function in mod_mainmenu? 是否可以从modMainMenuXMLCallback()
函数获取它? Thanks. 谢谢。
$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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.