I’ve created a module within the local code folder in our custom namespace. The block isn’t displaying on the frontend, and on checking the exception log, it turns out Magento is looking in the wrong place.
exception ‘Mage_Core_Exception’ with message ‘Invalid block type: Mage_MyCompany_ForthcomingProducts_Block_List’ in /var/www/html/app/Mage.php:407
The same also goes if I exclude the MyCompany_ prefix when calling the block; it still looks in the Mage namespace. I have this in a file called MyCompany_All.xml in the modules folder, and the CMS layouts I’ve added are working fine, so Magento is definitely loading it:
<?xml version="1.0"?>
<config>
<modules>
<MyCompany_CmsLayouts>
<codePool>local</codePool>
<active>true</active>
</MyCompany_CmsLayouts>
<MyCompany_ForthcomingProducts>
<codePool>local</codePool>
<active>true</active>
</MyCompany_ForthcomingProducts>
</modules>
</config>
Does anyone have any ideas as to what’s causing this?
Added: The block is being called by a static block with this template code:
{{block type="MyCompany_ForthcomingProducts/List" template="forthcomingproducts/list.phtml"}}
And the config.xml for the block is:
<?xml version="1.0" encoding="utf-8"?>
<config>
<modules>
<MyCompany_ForthcomingProducts>
<version>0.9</version>
</MyCompany_ForthcomingProducts>
</modules>
<global>
<blocks>
<forthcomingproducts>
<class>MyCompany_ForthcomingProducts_Block</class>
</forthcomingproducts>
</blocks>
</global>
</config>