3

I have a third party extension that is using an update handle on a few key pages that i'd like to remove:

<cms_page>
    <update handle="handle_name1" />
    <update handle="handle_name2" />
    <update handle="handle_name3" />
</cms_page>

Is there a way to remove these layout updates using local.xml? I am trying to avoid doing the "copy the layout file to my theme" bit.

3

As far as I know, this facility is not available with magento by default. You cannot remove a layout handle which has added to the layout via another layout update file.

When we perform an update handle inside anther layout handle as you shown above, what magento does is, it will update the layout by including the blocks which are defined inside the update handle along with existing blocks in the layout. So when we come to local.xml file, the update handle has no relevance at all. It made its effect by updating the layout tree with its defined blocks.

So the only thing, that you can do is remove blocks which are added via these update handles. However you need to be really care about this step. Because update handle may contain blocks which are using by magento layout in different section. You should not remove these blocks via local.xml. But you can surely remove custom blocks which are specific to the third party extension if that block content is not at all necessary. You can do this like below.

File : app\design\frontend\<package>/<theme>/layout/local.xml

<layout>
    <default>
        <remove name="name_of_custom_block_1 />
        <remove name="name_of_custom_block_2 />
        <remove name="name_of_custom_block_3 />
        .....
   </default>
</layout>

You need to fill the remove section by adding all of the custom blocks which are included via update handles.

| improve this answer | |
  • I suspected as much :( Unfortunately, the original update handles are quite large (hence the use of update handles I suppose), so I had to resort to copying the layout file into my theme. Thanks for explaining so clearly! – Laura Jan 23 '15 at 14:33

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.