Question

How do I remove a block from a group?

In catalog.xml there are (around line 210) actions like:

<block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml">
    <action method="addToParentGroup"><group>detailed_info</group></action>
</block>

So product.info gets a group called detailed_info with the blocks product.description and product.attributes.

As far as I know I can remove a whole block with

<action method="unsetChild"><name>NAME</name></action>

But that does not work for groups.

In app/code/core/Mage/Core/Block/Abstract.php there are the implementations for these actions. Methods like addToParentGroup() and addToChildGroup() as well as setChild() and unsetChild(). But there are no methods like removeFromParentGroup() or removeFromChildGroup().

How do I remove a block from such a group?

Ideas:

  • Copy the whole catalog.xml to my theme and delete that line from it.
  • Make a rewrite for app/code/core/Mage/Core/Block/Abstract.php in an own module to add methods to remove blocks from a group

The first idea is the least I would want to do and I would be reluctant to do the second.

Is there any standard magento way to do this?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top