Magento - remove block using update XML

前端 未结 2 1436
天涯浪人
天涯浪人 2021-02-12 10:44

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:22

    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.

提交回复
热议问题