Suppose there are two submenus - this is the PHP code to add two submenus -
$reports=true; JSubMenuHelper::addEntry(JText::_('COM_JGIVE_REPORTS'),'index.php?option=com_jgive&view=reports&layout=default',$reports); JSubMenuHelper::addEntry(JText::_('COM_JGIVE_PAYOUT_REPORTS'),'index.php?option=com_jgive&view=reports&layout=payouts',$reports);
As you can see the 'view' for 2 submenus is same and 'layouts' are different
$document=JFactory::getDocument(); //override active menu class to remove active class from other submenu $menuCssOverrideJs="$(document).ready(function() { $('ul>li> a[href$=\"index.php?option=com_jgive&view=reports&layout=payouts\"]:last').removeClass('active'); });"; $document->addScriptDeclaration($menuCssOverrideJs);
$document=JFactory::getDocument(); //override active menu class to remove active class from other submenu $menuCssOverrideJs="$(document).ready(function(){ $('ul>li> a[href$=\"index.php?option=com_jgive&view=reports&layout=default\"]:last').removeClass('active'); });"; $document->addScriptDeclaration($menuCssOverrideJs);
It works well on Joomla 2.5.x. :)
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.