Hi,
I am using the MbMenu extension in my app for creating a horizontal menu with two levels.
I’d like to give an ‘active’ class to a second-level menu item when I am browsing the corresponding view. (Second level / row of the menu is always visible if the parent menu item is active.)
I am using the ‘active’ property and I have already set it to ‘true’ (to make sure that the item has been set to ‘active’ - this is of course just for testing).
Unfortunately, the 2nd level item doesn’t get the ‘active’ class.
Here is a part of the code (protected/views/layouts/main.php):
$this->widget('ext.mbmenu.MbMenu',array(
'activateParents'=>true,
'items'=>array(
array(
'label'=>t('Produktów'), 'url'=>'/' . app()->language,
'items'=>array(
array('label'=>t('Kaczka'), 'url'=>array('/site/page', 'view'=>Yii::t('url','kaczka')),'active'=>true),
array('label'=>t('Gęś'), 'url'=>array('/site/page', 'view'=>Yii::t('url','ges')),'active'=>true),
...
Any help would be greatly appreciated.
UPDATE: it seems that ‘active’ set the parent <li> element active only and not its child. Both <li>-s should be set to active.