Magento News

 

Why does my custom Magento Module override the entire core module and produce no results?

I have been working on my first Magento module which is designed to extend the class Mage_Page_Block_Html_Head and change the functionality of getDefaultTitle(). Simple right?

I create a new file called Title.php in my module directory local/Company/Metadata/Block directory and in Title.php is the following code:

<?php
class Company_Metadata_Block_Title extends Mage_Page_Block_Html_Head
{

}

I have not even started to adjust the functionality of getDefaultTitle() and I already seem to be missing the boat.

When I upload the new module, it overrides the entire Head content of the page created by the Mage_Page_Block_Html_Head and I end up with empty head tags in my Html. Like this:

<head></head>

Where am I going wrong? Shouldn’t the above code (or lack of) in Title.php let the extended class do it’s thing until told to do so otherwise?

Here is my config file for the module:

<config>

<modules>
    <Company_Metadata>
        <version>0.0.1</version>
    </Company_Metadata>
</modules>

<global>
    <blocks>
        <page>
            <rewrite>
                <html_head>Company_Metadata_Block_Title</html_head>
            </rewrite>
        </page>
    </blocks>
</global>

</config>

Why does my custom Magento Module override the entire core module and produce no results?

Possibly Related Posts:


 

Leave a Reply