I'm pretty new to Magento and I've started learning to develop custom modules for the frontend. I've followed several guides and for some reason, none of them are working. It seems as though loadLayout and renderLayout are causing problems. I'm not sure if this is because I have a file in the wrong location, or what the problem is. I've tried loading the pages magento.x/helloworld magento.x/helloworld/index magento.x/index.php/helloworld. I'm getting a broken version of the default site. If I replace the lLayout and rLayout with an echo it works just fine. This is what I have:
app/code/local/Wrapids/Helloworld/etc/config.xml
<config>
<modules>
<Wrapids_Helloworld>
<version>0.1.0</version>
</Wrapids_Helloworld>
</modules>
<frontend>
<routers>
<helloworld>
<use>standard</use>
<args>
<module>Wrapids_Helloworld</module>
<frontName>helloworld</frontName>
</args>
</helloworld>
</routers>
<layout>
<updates>
<helloworld>
<file>helloworld.xml</file>
</helloworld>
</updates>
</layout>
</frontend>
</config>
app/code/local/Wrapids/Helloworld/controllers/IndexController.php
<?php
class Wrapids_Helloworld_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{
$this->loadLayout();
$this->renderLayout();
}
}
?>
/app/design/frontend/default/default/template/helloworld/page.phtml
text
app/design/frontend/default/default/layout/helloworld.xml
<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
<default>
<reference name="content">
<block type="helloworld/helloworld" name="hello" template="helloworld/page.phtml">
</reference>
</default>
</layout>
app/code/local/Wrapids/Helloworld/Block/Helloworld.php
<?php
class Wrapids_Helloworld_Block_Helloworld extends Mage_Core_Block_Template
{
}
?>