I was in the middle of writing some code for a Magento website, and I feel like I'm at odds with what I am trying to accomplish.
I am trying to write an extension which inserts 2 blocks:
Hello_Catalog_Block_Category_View: which overrides the Mage_Catalog_Block_Category_View Block with some extra functionality.
Hello_Catalog_Block_Custom: which is a customised class I want to create for this extension
Here's what I have tried to write in the config.xml file:
<blocks>
<catalog>
<rewrite>
<category_view>Hello_Catalog_Block_Category_View</category_view>
</rewrite>
<class>
<custom>Hello_Catalog_Block_Custom</custom>
</class>
</catalog>
</blocks>
Obvously if I tried this code when I refresh the browser, this doesn't work because I must have initialised the custom block the wrong way.
Now if I tried to write in this fashion:
<blocks>
<catalog>
<rewrite>
<category_view>Hello_Catalog_Block_Category_View</category_view>
</rewrite>
<class>Hello_Catalog_Block</class>
</catalog>
</blocks>
Now when I refresh the browser, the templates for Catalog Category view don't get rendered and I get the feeling it gets overridden by <class>Hello_Catalog_Block</class>
.
My question is, is there a way to write an extension that allows these 2 blocks to be used or together or would it just be a case where either you write an extension that overrides blocks or you write an extension that creates new blocks only, not both?
Thanks.