I have a custom module with the following:
magento-project/app/code/local/Hunique/Customs/etc/config.xml
<?xml version="1.0" ?>
<config>
<modules>
<Hunique_Customs>
<version>1.0.1</version>
</Hunique_Customs>
</modules>
<global>
<models>
<custommodule>
<class>Hunique_Customs_Model</class>
<resourceModel>custommodule_resource</resourceModel>
</custommodule>
<custommodule_resource>
<class>Hunique_Customs_Model_Resource</class>
<entities>
<custommodule>
<table>custommodule</table>
</custommodule>
<questions>
<table>questions</table>
</questions>
<answers>
<table>answers</table>
</answers>
</entities>
</custommodule_resource>
</models>
<resources>
<custommodule_setup>
<setup>
<module>Hunique_Customs</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</custommodule_setup>
<custommodule_read>
<connection>
<use>core_read</use>
</connection>
</custommodule_read>
<custommodule_write>
<connection>
<use>core_write</use>
</connection>
</custommodule_write>
</resources>
<blocks>
<custommodule>
<class>Hunique_Customs_Block</class>
</custommodule>
</blocks>
<helpers>
<hunique_customs>
<class>Hunique_Customs_Helper</class>
</hunique_customs>
</helpers>
</global>
<frontend>
<routers>
<custommodule>
<use>standard</use>
<args>
<module>Hunique_Customs</module>
<frontName>custommodule</frontName>
</args>
</custommodule>
</routers>
<layout>
<updates>
<custommodule>
<file>custommodule.xml</file>
</custommodule>
</updates>
</layout>
</frontend>
<admin>
<routers>
<adminhtml>
<use>admin</use>
<args>
<modules>
<Hunique_Customs before="Mage_Adminhtml">Hunique_Customs</Hunique_Customs>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<adminhtml>
<layout>
<updates>
<custommodule>
<file>custommodule.xml</file>
</custommodule>
</updates>
</layout>
</adminhtml>
Then I have the /magento-project/app/code/local/Hunique/Customs/etc/adminhtml.xml in the same folder
<config>
<menu>
<hunique>
<title>Hunique</title>
<sort_order>1</sort_order>
<children>
<customs_qa module="hunique_customs">
<title>Questions And Answers</title>
<sort_order>1</sort_order>
<action>adminhtml/custommodule</action>
</customs_qa>
</children>
</hunique>
</menu>
Then in the desing i have: /magento-project/app/design/adminhtml/default/default/layout/custommodule.xml
<?xml version="1.0"?>
<layout>
<adminhtml_custommodule_index>
<reference name="content">
<block type="core/template" output="toHtml" name="templateBlock" template="custommodule/questions-and-answers.phtml" />
</reference>
</adminhtml_custommodule_index>
</layout>
and I have the file /magento- project/app/design/adminhtml/default/default/templates/custommodule/questions-and-answers.phtml but that just contains an h1 tag with TEST in it now.
I also have the controller: /magento-project/app/code/local/Hunique/Customs/controllers/CustommoduleController.php
<?php
class Hunique_Customs_CustommoduleController extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
var_dump(Mage::getSingleton('core/layout')->getUpdate()->getHandles());
$this->loadLayout();
$this->renderLayout();
}
}
I have the var dump to see if i had any handles but that is an empty array. My page loads from the admin menu.. My routes and admin menu work fine, i just can't get my phtml to show up... anyone that can point me in the right direction?