Magento: <action method="unsetChild"> Not removing a block

mrN picture mrN · Sep 14, 2012 · Viewed 16.2k times · Source

I switch the display of Wishlist_Sidebar from right to left, using the following codes, but the sidebar remains in both right and left sidebar.

<reference name="right">                
    <action method="unsetChild"><name>wishlist_sidebar</name></action>
    //.....
</reference>
<reference name="left">
     <action method="insert"><blockName>wishlist_sidebar</blockName></action>
</reference>

How to fix this problem

Answer

Peter O&#39;Callaghan picture Peter O'Callaghan · Sep 14, 2012

I think the unsetChild function might operate using the alias (the as attribute rather than the name attribute. Try using...

<reference name="right">                
    <action method="unsetChild"><name>wishlist</name></action>
    //.....
</reference>