I am trying to create a custom module and enabling it in a CMS Page.
I've already done this before and everytime some issue comes up and I could figure this out anyhow.
I couldn't figure out what's the issue this time. Below are the code that I've been trying to make it work.
**app/etc/modules/Vickythegme_CMS.xml**
<?xml version="1.0"?>
<config>
<modules>
<Vickythegme_CMS>
<active>true</active>
<codePool>local</codePool>
</Vickythegme_CMS>
</modules>
</config>
Module config XML
**app/code/local/Vickythegme/CMS/etc/config.xml**
<?xml version="1.0"?>
<config>
<modules>
<Vickythegme_CMS>
<version>0.0.1</version>
</Vickythegme_CMS>
</modules>
<frontend>
<routers>
<vickythegme_cms_render>
<use>standard</use>
<args>
<module>Vickythegme_CMS</module>
<frontName>tryon</frontName>
</args>
</vickythegme_cms_render>
</routers>
<layout>
<updates>
<vickythegme_cms>
<file>vickythegme_cms.xml</file>
</vickythegme_cms>
</updates>
</layout>
<global>
<blocks>
<vickythegme_cms>
<class>Vickythegme_CMS_Block</class>
</vickythegme_cms>
</blocks>
</global>
</frontend>
</config>
Design Layout XML File
**design/frontend/base/default/layout/vickythegme_cms.xml**
<layout version="0.1.0">
<default>
<reference name="content" />
</default>
<vickythegme_cms_render_index_index>
<reference name="content">
<block type="cms/tryon" name="tryon_tryon" template="cms/tryon.phtml" />
</reference>
</vickythegme_cms_render_index_index>
</layout>
Block tryon.php file
**code/local/Vickythegme/CMS/Block/tryon.php**
class Vickythegme_CMS_Block_Tryon extends Mage_Core_Block_Template
{
public function methodblock()
{
return 'testing block';
}
}
Controller File
**code/local/Vickythegme/CMS/controllers/IndexController.php**
class Vickythegme_CMS_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{
$this->loadLayout();
$this->renderLayout();
}
public function methodAction()
{
echo 'test method';
}
}
tryon phtml file
**design/frontend/base/default/template/vickythegme/cms/tryon.phtml**
test content
I've cleared the cache and tried as well. Its not working.
The url that I am checking
http://magento-15667-34663-87261.cloudwaysapps.com/try-on
try-on is the CMS Page that I created with the block code
{{block type="cms/tryon" name="tryon_tryon" template="cms/tryon.phtml"}}
And the page url that I should be checking directly gives me 404 error.
http://magento-15667-34663-87261.cloudwaysapps.com/tryon/index
And btw, I've enabled logging, still I don't get any error in the log related to this module.
I'm not even sure whether the module is running or not.
I'm not sure what's happening. If you guys could help me out in this issue, it'd be really awesome.
Thanks in advance.