I am having a difficult time getting the MVC structure set up for an admin module I am building for Magento. What I am hoping to do is correctly set up the design/adminhtml/layout/ppr_extension.xml
to control the content of the page. So far I am loading the phtml and scripts from the IndexController :
$this->loadLayout();
$this->_setActiveMenu('ppr_menu/first_page');
$this->_addContent($this->getLayout()->createBlock('adminhtml/template')->setTemplate('ppr/ppr_1.phtml'));
$loadSimple = $this->getLayout()->getBlock('head')->addJs('ppr/load.simple.js');
$this->_addJs($loadSimple);
$this->renderLayout();
I want to load this from the config xml but for some reason I can not get this work. I imagine it has something to do with my package structure but I can not see it!
The template file exists in design/adminhtml/default/MyPackage/ppr_1.phtml
I tried adding this to the code/local/MyPackage/PPR/etc/config.xml
<adminhtml>
<menu> ... </menu>
<layout>
<updates>
<ppr_extension>
<file>ppr_extension.xml</file>
</ppr_extension>
</updates>
</layout>
</adminhtml>
That extension xml is in design/adminhtml/default/default/layout/ppr_extension.xml
I tried many things in here like :
<?xml version="1.0"?>
<layout version="0.1.0">
<ppr_adminhtml_ppr_index>
<reference name="head">
<action method="addJs"><script>script.js</script></action>
</reference>
No matter what I put in there nothing seems to happen. What am I missing?
I tried moving the extension.xml to design/adminhtml/MyPackage/layout but that didnt work either. Thanks for any help.. me brain hurts!
}array(4) { [0]=> string(7) "default" [1]=> string(11) "STORE_admin" [2]=> string(30) "THEME_adminhtml_default_company" [3]=> string(24) "ppr_node_one_index_index" } bailing early at 22 in /home/magento/site/app/code/local/company/PPR/controllers/IndexController.php
so I changed my handle to ppr_node_one_index_index but it still is not working. Thanks for any more help. – Zac