Orange Collar Media
Orange Collar Media
DOCS
ORANGECOLLAR/MODULE-WORDPRESS-INTEGRATION · MENUS

Configure WordPress navigation menu fetching and rendering in Magento layouts

  • Magento
  • Adobe Commerce
  • Hyvä

The Menus group enables fetching and rendering WordPress navigation menus within Magento pages.

Admin path: Stores > Configuration > Orange Collar > WordPress Integration > Menus

Settings

Enable WordPress Menus

Enables the menu fetching system. When disabled, no menu API calls are made to WordPress.

  • Default: No (disabled)

How Menu Integration Works

When enabled, the module fetches menu data from the WordPress oc-bridge/v1/menus endpoint, which returns the full menu tree including labels, URLs, and nesting levels.

The response structure from /wp-json/oc-bridge/v1/menus looks like:

JSON
[
  {
    "id": 1,
    "name": "Primary Navigation",
    "slug": "primary",
    "items": [
      {
        "id": 10,
        "title": "Home",
        "url": "https://blog.example.com/",
        "parent": 0,
        "children": []
      },
      {
        "id": 11,
        "title": "About",
        "url": "https://blog.example.com/about/",
        "parent": 0,
        "children": [
          {
            "id": 12,
            "title": "Our Team",
            "url": "https://blog.example.com/about/team/",
            "parent": 11,
            "children": []
          }
        ]
      }
    ]
  }
]

Adding a Menu Block

To render a WordPress menu in a Magento layout, add a block to your layout XML:

XML LAYOUT
<block class="OrangeCollar\WordPressIntegration\Block\Menu"
       name="wordpress.menu.primary"
       template="OrangeCollar_WordPressIntegration::menu.phtml">
    <arguments>
        <argument name="menu_location" xsi:type="string">primary</argument>
    </arguments>
</block>

The menu_location argument accepts either a menu location slug or a menu slug directly.

Cache

NOTE /

Menu data is cached with the WORDPRESS_MENU cache tag. When a WordPress navigation menu is updated, the oc-magento-bridge plugin sends a webhook that purges this tag, causing the next page load to fetch fresh menu data.