How do I add a submenu to an existing menu in Magento?

How do I add a submenu to an existing menu in Magento?

September 28, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How do I add a submenu to an existing menu in Magento?

Expanding Your Magento Menu: Adding a Submenu Item

Hello developers! Today we’re going to dive into Magento’s menu system and explore how to create a submenu item for an existing menu. We’ll be using the adminhtml.xml file to define our custom menu structure.

Understanding the Current Setup

You’ve already set up a basic custom menu in your adminhtml.xml file, which looks like this:

<config>
    <menu>
        <mycustom_menu translate="title" module="brands">
            <title>My Custom Menu Item</title>
            <sort_order>300</sort_order>
            <children>
                <!-- child items go here -->
                <subitem translate="title" module="brands">
                    <title>Manage Brands</title>
                    <sort_order>10</sort_order>
                    <action>adminhtml/mycustom_controller/</action>
                </subitem>
            </children>
        </mycustom_menu>
    </menu>
    <!-- ... ACL section omitted for brevity ... -->
</config>

This XML structure defines a new top-level menu item called “My Custom Menu Item”. It also includes a single subitem named “Manage Brands” with an action that points to a custom controller.

The Goal: Creating a Submenu Under the Catalog Menu

Your current menu appears on the side navigation bar as a standalone item. However, you want this menu to be a submenu under the existing Catalog menu. To achieve this, we need to modify the XML structure and use Magento’s built-in menu hierarchy.

Step 1: Identify the Parent Menu ID

Before we start, let’s identify the unique ID of the parent menu (Catalog) that you want your custom menu to appear under. In Magento 2, the Catalog menu has an ID called Magento_Catalog::catalog. We’ll use this ID in our XML.

Step 2: Update the XML Structure

To create a submenu, we need to nest our custom menu inside the parent menu’s children tag. Here’s how you should update your adminhtml.xml file:

<config>
    <menu>
        <Magento_Catalog::catalog translate="title" module="Magento_Catalog">
            <children>
                <!-- Existing Catalog menu items -->
                <Magento_Catalog::custom_menu translate="title" module="brands">
                    <title>My Custom Menu Item</title>
                    <sort_order>300</sort_order>
                    <children>
                        <!-- child items go here -->
                        <subitem translate="title" module="brands">
                            <title>Manage Brands</title>
                            <sort_order>10</sort_order>
                            <action>adminhtml/mycustom_controller/</action>
                        </subitem>
                    </children>
                </Magento_Catalog::custom_menu>
            </children>
        </Magento_Catalog::catalog>
    </menu>
    <!-- ... ACL section omitted for brevity ... -->
</config>

Notice that we’ve added the Magento_Catalog::custom_menu tag inside the Magento_Catalog::catalog children. This tells Magento to treat your custom menu as a submenu under the Catalog menu.

Step 3: Verify the Changes

After making this change, clear your Magento cache and refresh the admin interface. You should now see your “My Custom Menu Item” appearing as a subitem under the main Catalog menu.

Conclusion and Next Steps

That’s it! With these changes in place, you’ve successfully created a submenu for your existing custom menu in Magento 2. Remember, working with XML files requires careful attention to the structure and tag names.

I recommend checking out our comprehensive guide on Customizing Magento Menus if you want to explore more advanced techniques or need help troubleshooting issues.

Happy coding! Let me know in the comments if you have any questions or suggestions for future topics.

Catalog Extensions Admin Configuration

Our network