All of the configuration XML is merged into a single DOM structure in a way that means colliding xpaths will have their text values overridden. An example:
This community module is currently rewriting the resolved classname via configuration:
<config>
<global>
<blocks>
<catalog>
<rewrite>
<product_price>Community_Module_Block_Example_Price</product_price>
</rewrite>
</catalog>
</blocks>
</global>
</config>
The framework invokes block classes using Mage_Core_Model_Layout::createBlock()
, with the argument in this case being catalog/product_price
(note how those two strings map to the configuration). The community module is changing the classname which is calculated from this information, and pointing it to the classname specified i.e. Community_Module_Block_Example_Price
. That classname is then fed to PHP new
to invoke a class.
What you need to do is copy this exact configuration to your module config - specifying your block classname - and (important!) make sure that the following occur:
- your configuration is loaded after the community module's configuration, and
- that your class extends from the community module's class.
How do you make sure that your module configuration is loaded after the community module? Just open the community module's declaration file in app/etc/modules, note the node name under the <modules>
node (in the example above, would almost certainly be Community_Module
), and then in your module declaration file (also in app/etc/modules), add this to your module declaration:
<depends>
<Community_Module /> <!-- e.g. -->
</depends>
HTH