0

I am just a newbie to magento. I want to add two menus in the top menu section of admin dashboard. The menu will be like this

Storeinfo(parent)
  Store1(child menu level1/dropdown1)
  Store2(child menu level2/dropdown2)

So that when I will make hover on Storeinfo menu it should show Store1 and Store2 as dropdown. For that my config.xml file is like this

<adminhtml>
  <menu>
    <storeinfo module="storeinfo">
      <title>Storeinfo</title>
      <sort_order>71</sort_order>
      <children>
        <items module="storeinfo">
          <title>Store1</title>
          <sort_order>1</sort_order>
          <action>storelocator/adminhtml_storeinfo</action>
        </items>
        <items module="storeinfo">
          <title>Store2</title>
          <sort_order>0</sort_order>
        </items>            
      </children>
    </storeinfo>
  </menu>
</adminhtml>

But here with this code I can see only Store2 from the dropdown. So I want to know how can I show two dropdown menus? Any help and suggestions will be really appreciable. Thanks

1

Rename your second menu tag into something else.
I mean rename this:

<items module="storeinfo">
   <title>Store2</title>
   <sort_order>0</sort_order>
</items> 

To

<items1 module="storeinfo">
   <title>Store2</title>
   <sort_order>0</sort_order>
</items1> 

A menu tag must be unique in the xml structure. Adding a second item with the same name causes the first one to be overwritten.
[EDIT]
If your initial xml worked but was showing only one submenu this should show you the full menu:

<adminhtml>
  <menu>
    <storeinfo module="storeinfo">
      <title>Storeinfo</title>
      <sort_order>71</sort_order>
      <children>
        <items module="storeinfo">
          <title>Store1</title>
          <sort_order>1</sort_order>
          <action>storelocator/adminhtml_storeinfo</action>
        </items>
        <items1 module="storeinfo">
          <title>Store2</title>
          <sort_order>0</sort_order>
        </items1>            
      </children>
    </storeinfo>
  </menu>
</adminhtml>
  • thanks for the reply, I have updated my question kindly check it. – NewUser Sep 27 '13 at 14:08
  • @NewUser. I've updated the answer – Marius Sep 27 '13 at 14:13
  • when I made like your code then the main menu (Storeinfo) is disappearing now. – NewUser Sep 27 '13 at 14:16
  • @NewUser I've added the full xml. Check now. – Marius Sep 27 '13 at 14:29

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.