0

I just started to use Magento and tried a few tutorials and have been reading documentation but now im stuck at making a custom menu with multiple items.

<config>
  <menu>
      <menuitem translate="title" module="test_helloworld">
        <title>Test</title>
        <sort_order>1</sort_order>
        <children>
            <item>
                <title>Index</title>
                <sort_order>1</sort_order>
                <action>helloworld/index</action>
            </item>
           <item>
                <title>Exit</title>
                <sort_order>2</sort_order>
                <action>helloworld/Exit</action>
            </item>
        </children>
    </menuitem>
  </menu>
</config>

The action is working and its opening desired page, but i have the problem with displaying first item <title>Index</title> that is in this code. If i remove Exit then it displays index. What am i doing wrong here do i have to do something in config.xml (didnt put permisions yet) as i am learning so only use admin account.

1

<item> is the identifier and should be unique. Here you are overwriting the top menu item immediately.

<config>
  <menu>
      <menuitem translate="title" module="test_helloworld">
        <title>Test</title>
        <sort_order>1</sort_order>
        <children>
            <item_index>
                <title>Index</title>
                <sort_order>1</sort_order>
                <action>helloworld/index</action>
            </item_index>
           <item_exit>
                <title>Exit</title>
                <sort_order>2</sort_order>
                <action>helloworld/Exit</action>
            </item_exit>
        </children>
    </menuitem>
  </menu>
</config>
1
  • oh i understood it wrong then,still getting used to magento. Thank you for the explanation
    – MePo
    Oct 14 '15 at 9:51

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.