I have gone through various Magento tutorials as well as a Magento book on layout, but I'm stuck with the following problem.
I have created a custom module, located in app/code/local/Company/Module/ . I have created a block Company_Module_Block_Ablock located in Company/Module/Block/Ablock.php. I have defined <config> ... <frontend><layout><updates><module><file>module.xml
in Company/Module/etc/config.xml
config.xml also has
<global>
<blocks>
<module>
<class>Company_Module_Block</class>
</module>
</blocks>
</global>
Inside this module.xml I have:
<layout>
<company_module_index_index>
<reference name="content">
<block type="module/ablock" name="myablock" template="module/ablock.phtml" />
</reference>
</company_module_index_index>
</layout>
I have created a Company/Module/controllers/IndexController.php and have a indexAction defined there which does
$this->loadLayout();
$this->renderLayout();
But whatever I try I'm unable to get my ablock.phtml to display. ablock.phtml is in app/design/frontend/company/default/template/module/ablock.phtml. The theme has been enabled and is generally working on the site.
I have even tried to change module.xml inside layout so its not even using a template and even this is not displaying anything. Like this -
<reference name="content">
<block type="core/text">
<action method="setText">
<text>Testing</text>
</action>
</block>
</reference>
By the way the custom theme works fine otherwise, other pages have content displayed in them in the correct place.
I have SetEnv MAGE IS DEVELOPER MODE 1
in .htaccess which is supposed to help display even warnings and things. But my systems.log and exceptions.log have no errors in them. (Yes logging is turned on)
Anyone have any advise on how to troubleshoot this or can spot a mistake in the configuration or code?
My next option seems to be hacking the core module code and logging where my module.xml is being loaded and parsed to see what is going on there.
Thanks.
routers/[foo]/*
section forconfig.xml
. I can't remember if it uses the value in thefrontName
tag, or if it uses the name of the tag itself ("[foo]
") – Alana Storm Aug 13 '11 at 20:44