3

I want to change my custom module (named MODEL) menu position in Magento Admin panel. Right now it is added at last. I want something like this.

enter image description here

  • Thanks all for answers. I will vote for amit as he answered first. – HungryDB Nov 4 '14 at 13:00
6

Magento is manage it menu item position by tag <sort_order> and it this code is exit in adminhtml.xml file of your module.

Just change it value.

<sort_order/>

Each menu item has a sort order. For top level menu items, lower numbers will sort further to the left, higher numbers to the right. For sub-menu items the sort is top/down.

<sort_order>Numerical value</sort_order> in adminhtml .xml of your extension.

Example:

<menu>
        <mycustomtab module="jr_createadmincontroller" translate="title">
            <title>My Custom Tab</title>
<!-- need to change here  -->
            <sort_order>100</sort_order>
            <children>
                <index module="jr_createadmincontroller" translate="title">
                    <title>Index Action</title>
                    <sort_order>1</sort_order>
                    <action>adminhtml/custom</action>
                </index>
                <list module="jr_createadmincontroller" translate="title">
                    <title>List Action</title>
                    <sort_order>2</sort_order>
                    <action>adminhtml/custom/list</action>
                </list>
            </children>
        </mycustomtab>
    </menu>

More details at http://alanstorm.com/magento_admin_controllers

  • its already 100. Any other solution? – HungryDB Nov 4 '14 at 12:35
  • just decrease it value – Amit Bera Nov 4 '14 at 12:36
  • Upvote from me .For good question and Please add more details to your question – Amit Bera Nov 4 '14 at 12:45
2

You should be able to add a config in here:

/app/code/local/Company/YourModule/etc

Call this file adminhtml.xml

Put the following code in there:

<config>
    <menu>
        <yourmodule module="yourmodule">
            <title>Navigation Link Title</title>
            <sort_order>1</sort_order>
        </yourmodule>
    </menu>
</config>

Adjust the number in sort_order to suit your needs

2

For an example, this is the code for dashboard menu that appears "first" in admin panel main menu section. If you look on the menu definition of this menu (Which is available in adminhtml.xml of core module Mage_Adminhtml), you can see that, it uses the node sort_order for positioning itself in the menu section.

<config>
    <menu>
        <dashboard translate="title" module="adminhtml">
            <title>Dashboard</title>
            <sort_order>10</sort_order>
            <action>adminhtml/dashboard</action>
        </dashboard>
       ....
   </menu>
</config>

Have a look on that adminhtml.xml file. You will get an idea what value should given for your custom menu in order to position it in desired location .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.