i already know how to parse id/name and stuff from my current/active menu-item, but i want to know if it's part of a specific menu for example:
I have this Menu with the name "mainmenu" and type "mainmenu": Home | About | Contact | Testing
If i click on About i want to know if About is part of "mainmenu" - how can i do that?
like this:
$app = JFactory::getApplication();
$menu = $app->getMenu();
$activeitem = $menu->getActive()->id;
// And now the if-statement - which asks if activeitem is part of "mainmenu" and if yes do that, and if not do that...
I hope you know what i mean...
Thanks for any help
You can check menutype using below code -
$app = JFactory::getApplication();
$menu = $app->getMenu();
$menutype = $menu->getActive()->menutype;
if($menutype =='mainmenu'){//check if active menu part of 'mainmenu'
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다