Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6033301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:27:50+00:00 2026-05-23T05:27:50+00:00

What is the difference between remove and unsetChild methods in layout? For example (in

  • 0

What is the difference between remove and unsetChild methods in layout?

For example (in poll.xml layout file):

<customer_account_index>
    <reference name="right">
        <action method="unsetChild"><name>catalog_compare_sidebar</name></action>
    </reference>
</customer_account_index>

Why unsetChild and not just remove?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T05:27:51+00:00Added an answer on May 23, 2026 at 5:27 am

    Remove nodes will be processed after all layout handles are merged, and are a good way to remove a block regardless of which layout handle loaded the block; you just want to get rid of it entirely for some handles! It also removes recursively, so all you need to specify is the layout handle.

    On the other hand, you may only want to remove a block from a reference in a specific layout handle, in which case you should use unsetChild. It is often used to remove a block from a reference, but then re-insert the same block with a different position. This would not have been possible with remove.

    In your very specific example, the magento developers used it to give magento some flexibility. Let’s say I added a subpage for the account index page, and the following layout handles were loaded:

    • default
    • …
    • customer_account_index
    • customer_account_index_subpage

    And now assume on this subpage I would actually want the ‘catalog_compare_sidebar’ block. If they had used ‘remove’, I would not be able to add this block (with this specific name) because ‘remove’ would be processed -after- I had added the block myself.

    This allows you to easily make changes from one single file; local.xml.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What's the difference between empty() and remove() methods in jQuery , and when we
What is really the difference between the algorithms remove and remove_if and the member
I wonder what is the difference between these two: gcc -s : Remove all
I am bit confused about the difference between the usage of std::remove algorithm. Specifically
What is the difference between %1 and $1 in .htaccess? For example, # to
What is the difference between [0-9]{1,2} and ^[0-9]{1,2}$ ? If we remove ^ and
What is the difference between remove and unlink functions in C++?
Difference between a bus error and a segmentation fault? Can it happen that a
The difference between Chr and Char when used in converting types is that one
What is the difference between early and late binding?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.