Magento - remove block using update XML Magento - remove block using update XML xml xml

Magento - remove block using update XML


There are two methods to remove a block defined in one layout xml file, through another xml file:

<default>    <reference name="top.switches">        <action method="unsetChild"><name>currency</name></action>    </reference></default>

And the way you are conventionally expected to do it:

<default>    <reference name="top.switches">        <remove name="currency" />    </reference></default>

You can find an explanation of the various layout xml elements here, but it doesn't cover the methods available to the action tag. For that, you need to look at the block class app/code/core/Mage/Core/Block/Abstract.php, which features all sorts of useful functions such as unsetChild, unsetCallChild, insert, sortChildren, etc.


add file named local.xml in your layout directory . then in local.xml you can remove any block with "remove" tag . BTW the remove tag should be between "layout" and "default" then the file should be :

<?xml version="1.0" encoding="UTF-8"?><layout>   <default>     <remove name="BLOCK_NAME" />  </default></layout>