6.1
  • Getting started
  • System Architecture
  • Source Code Documentation
  • OXID eShop components
  • Project resources
  • Module resources
    • Module skeleton: metadata, composer and structure
      • metadata.php
      • composer.json
      • menu.xml
        • Menu entry
        • Menu translation
      • File and folder structure
    • Testing
    • Interacting with the database
    • Using namespaces
    • Tutorials and recipes
    • Best practices
    • Module Certification
  • Theme resources
  • Update
  • Conventions for writing developer documentation
  • Glossary
OXID eShop developer documentation
  • Docs »
  • Module resources »
  • Module skeleton: metadata, composer and structure »
  • menu.xml
  • Edit on GitHub

menu.xml¶

Menu entry¶

In order to provide an admin menu entry, you need to add a menu.xml in the root folder of your module.

.
├── composer.json
├── metadata.php
├── menu.xml
├── ...

This will be automatically loaded and added. The order for the admin menu structure:

  1. source/Application/views/admin/menu.xml

  2. source/Application/views/admin/user.xml

  3. Module menu.xml

Menu.xml Examples¶

The following example is introducing a new main menu point within a new submenu entry:

<?xml version="1.0" encoding="UTF-8"?>
<OX>
    <OXMENU id="NAVIGATION_ESHOPADMIN">
        <MAINMENU id="EXAMPLE_MODULE_MAINMENU">
            <SUBMENU id="EXAMPLE_MODULE_START" cl="EXAMPLE_MODULE_CONTROLLER" />
        </MAINMENU>
    </OXMENU>
</OX>

This example extends an already existing menu entry and list page with a new tab:

<?xml version="1.0" encoding="UTF-8"?>
<OX>
    <OXMENU id="NAVIGATION_ESHOPADMIN">
        <MAINMENU id="mxorders">
            <SUBMENU id="mxdisplayorders" cl="admin_order" list="order_list">
                <TAB id="EXAMPLE_MODULE_ORDERS" cl="EXAMPLE_MODULE_CONTROLLER" />
            </SUBMENU>
        </MAINMENU>
    </OXMENU>
</OX>

The next example also adds a new list within one submenu:

<?xml version="1.0" encoding="UTF-8"?>
<OX>
    <OXMENU id="NAVIGATION_ESHOPADMIN">
        <MAINMENU id="EXAMPLE_MODULE_MAINMENU">
            <SUBMENU id="EXAMPLE_MODULE_SHOW" cl="EXAMPLE_MODULE_FRAME" list="EXAMPLE_MODULE_LIST_VIEW">
                <TAB id="EXAMPLE_MODULE_MAIN" cl="EXAMPLE_MODULE_CONTROLLER"/>
                <TAB id="EXAMPLE_MODULE_DESCRIPTION" cl="EXAMPLE_MODULE_CONTROLLER"/>
            </SUBMENU>
        </MAINMENU>
    </OXMENU>
</OX>

Menu translation¶

There are 2 ways of providing the translation for the menu entries added through the menu.xml.

Translation files¶

Either add it to the admin lang files Admin modules translation

Module options¶

It could also be added using module_options.php Admin modules translation

Note

While using ‘module_options.php’ for translation, the translations will only be loaded while being logged in as admin.

Next Previous

© Copyright 2017 - 2023, OXID eSales AG.

OXID docs OXID docs | Imprint | Privacy | Contact
Documentation v: 6.1
Versions
6.1
6.2
6.3
6.4
6.5
This is the developer documentation for OXID eShop 6.1, which has reached End of Life (EOL) and is no longer supported.