Home » Php » php – Menu highlight in magento under admin

php – Menu highlight in magento under admin

Posted by: admin July 12, 2020 Leave a comment

Questions:

I add submenu in admin under parent menu but when we select submenu, only one submenu will highlight in admin and other would not highlight.

I have add following code in config.xml file.

<menu>
<customersettings module="customersettings">
<title>Advance Settings</title>
<sort_order>100</sort_order>               
<children>                  
<customersettings module="customersettings">
<title>Customer Settings</title>
 <sort_order>0</sort_order>                               
     <action>customersettings/adminhtml_customersettings</action> 
</customersettings>                             
</children>             
</customersettings>
</menu>

Please give me some suggestions, thanks.

How to&Answers:

In your controller file you can add

public function _initAction()
 {
    $this->loadLayout()->_setActiveMenu('customersettings/customersettings');

     return $this;
}

This will highlight the menu when a sub menu is selected.

Hope I’m right
.