Here's my controller
<?php
class Desbest_Brands_Adminhtml_BrandController extends Mage_Adminhtml_Controller_action {
public function indexAction() {
//echo "showing 123 works!";
$this->loadLayout(); $this->renderLayout();
}
And here's my layout
<?xml version="1.0"?>
<layout version="1.0.0">
<brands_adminhtml_brand_index>
<reference name="content">
<block type="brands/adminhtml_brand" name="brand" />
<block type="newsletter/subscribe" name="left.newsletter" template="newsletter/subscribe.phtml"/>
</reference>
</brands_adminhtml_brand_index>
</layout>
Yet nothing loads up when I show the view in my admin, not even the email subscribe form.
If your action is called correctly (echo 123 shown), other than cache issue, there might be something's wrong with your handle.
In your action, try to put this code after $this->loadLayout()
:
var_dump(Mage::getSingleton('core/layout')->getUpdate()->getHandles());
die();
It will show all the handles loaded for that request.
The handle is generated from fullActionName, in simple way, we can say that it is generated as:
route + controller + action
Take a look at your config.xml.
If your config.xml like:
<admin>
<routers>
<brands>
<use>admin</use>
<args>
<module>Desbest_Brands</module>
<frontName>brands</frontName>
</args>
</brands>
</routers>
</admin>
For your action, it will generate handle: <brands_adminhtml_brand_index>
If your config.xml like:
<admin>
<routers>
<brandsadmin>
<use>admin</use>
<args>
<module>Desbest_Brands</module>
<frontName>brands</frontName>
</args>
</brandsadmin>
</routers>
</admin>
For your action, it will generate handle: <brandsadmin_adminhtml_brand_index>
Update:
And don't forget to define your admin layout in your config.xml, eg:
<adminhtml>
<layout>
<updates>
<brandsadmin>
<file>yourlayoutname.xml</file>
</brandsadmin>
</updates>
</layout>
</adminhtml>
Put it under app/design/adminhtml/default/[default/youradmintheme]/layout/yourlayoutname.xml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With