2

I want to remove navbar from a custom magento admin panel popup. I have already removed header and footer, but can not remove navbar panel.

Please help

<adminhtml_catalog_product_xyz>


    <remove name="footer" />

    <remove name="header" />
    <remove name="top.menu" />
    <remove name="top.links" />
    <remove name="top.container" />


    <reference name="content">
        <remove name="nav-bar" />
        <remove name="header" />
        <block type="core/template" name="xyz" template="abc/test/test.phtml" />
    </reference>


</adminhtml_catalog_product_xyz> 

enter image description here

2

Add

<remove name="menu" />

Your XML file will be

<adminhtml_catalog_product_xyz>


    <remove name="footer" />

    <remove name="header" />
    <remove name="top.menu" />
    <remove name="menu" />
    <remove name="top.links" />
    <remove name="top.container" />


    <reference name="content">
        <remove name="nav-bar" />
        <remove name="header" />
        <block type="core/template" name="xyz" template="abc/test/test.phtml" />
    </reference>


</adminhtml_catalog_product_xyz> 

However, please note that as part of Magento admin controller, the following function will be called

Mage_Adminhtml_Controller_Action->_setActiveMenu()

That function will do this

$this->getLayout()->getBlock('menu')->setActive($menuPath);

Because we already removed that per the above XML, it will throw an exception.

To prevent this, override _setActiveMenu() in your controller (e.g. YourName/YourModule/controller/Adminhtml/Catalog/ProductController.php) by adding

protected function _setActiveMenu(){
    return false;
}

It should now work.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.