|
Hello
The syntax for the layout updates depends on the structure of your controller for the admin area.
If you go to your admin menu configuration file (adminhtml.xml or config.xml) you’ll probably see something like this....
..... <config> <menu> <my_module module="my_module"> <title>My module</title> <sort_order>10</sort_order> <children> <node module="my_module"> <title>Menu title</title> <sort_order>0</sort_order> [b]<action>adminhtml/controllerfolder_controller</action>[/b] </node> </children> .....
Here we can see this menu goes to a controller in folder structure of:
/app/code/local/My/Module/controllers/Adminhtml/Controllerfolder/Controller.php
As I wanted it to go to the index action of my controller I didn’t need to specify an index action!
You could loose the ‘controllerfolder’ if you wish, it just helps group the controllers together, if we did action would become:
<action>adminhtml/controller</action>
Therefore your layout XML update handle in my example above (with the folder), it would be:
adminhtml_controllerfolder_controller_index
Or without:
adminhtml_controller_index
Handy tip: You can also tell what handle Magento is expecting by looking at the HTML classes applied to the body tag. (just view it in your browser, Chrome for example).
I hope this helps.
Cheers
Matt
|