I’m having trouble getting my layout xml file loaded into the system. I need it loaded in adminhtml for a module I’m building, so here’s the part of the config that matters:
<adminhtml>
<layout>
<updates>
<coupsmart_coupon>
<file>coupsmart_coupon.xml</file>
</coupsmart_coupon>
</updates>
</layout>
</adminhtml>
Now, the actual layout file, named coupsmart_coupon.xml file, is as follows:
<layout>
<coupsmart_coupon_adminhtml_coup_index>
<update handle="coupsmart_coupon"/>
<reference name="content">
<block type="coupsmart_coupon/adminhtml_forms" name="myform"/>
</reference>
</coupsmart_coupon_adminhtml_coup_index>
</layout>
Now, to debug this, I put an error in the layout xml file, such as leaving out a closing bracket (>), and I got no exceptions. So I checked the handles using $this->getLayout()->getUpdate()->getHandles() in my controller, and I got back coupsmart_coupon_adminhtml_coup_index as one of the handles, which is exactly what I named the handle in my layout xml file. Why else would this not be loading?
Note: I have cleared cache and tried again. Still not working. I also do have logs on and exceptions on, so an exception should have shown in my logs. If any other code is needed let me know.
Figured it out, because
adminhtml.xmldoesn’t add to the DOM, and the xml file was actually located inetc/adminhtml.xmland notconfig.xml. When I moved the layout update to config, it looked as follows:And now it works. Thanks all for helping.