Magento - remove block using update XML

前端 未结 2 763
臣服心动
臣服心动 2021-02-12 10:53

How do I use a layout xml file to remove an already existing block? Specifically, I want to remove the block named \"currency\" from the block named \"top.switches\". It is bein

2条回答
  •  情话喂你
    2021-02-12 11:29

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

    
        
            currency
        
    
    

    And the way you are conventionally expected to do it:

    
        
            
        
    
    

    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.

提交回复
热议问题