Skip to main content
AI/MLCrestApps

orchardcore-menus

Skill for creating and managing menus in Orchard Core. Covers menu content types, menu item types, menu widgets, navigation rendering, pager shapes, breadcrumbs, and menu customization via shapes and alternates. Use this skill when requests mention Orchard Core Menus, Create and Manage Navigation Menus, Enabling Menu Features, Menu Item Types, Creating a Menu via Recipe, Multi-Level Navigation Menu, or closely related Orchard Core implementation, setup, extension, or troubleshooting work. Strong matches include work with OrchardCore.Menu, OrchardCore.Widgets, OrchardCore.Layers, OrchardCore.ContentManagement, OrchardCore.Navigation, OrchardCore.Navigation.MenuItem, OrchardCore.Modules, MenuItemsListPart, MenuWidget, LinkMenuItemPart, MenuPart, TitlePart. It also helps with menus examples, Creating a Menu via Recipe, Multi-Level Navigation Menu, Placing a Menu Widget in a Zone, plus the code patterns, admin flows, recipe steps, and referenced examples captured in this skill.

Stars
13
Source
CrestApps/CrestApps.AgentSkills
Updated
2026-05-29
Slug
CrestApps--CrestApps.AgentSkills--orchardcore-menus
View on GitHubRaw SKILL.md

// install — copy + paste into any project

mkdir -p .claude/skills && curl -fsSL https://raw.githubusercontent.com/CrestApps/CrestApps.AgentSkills/HEAD/plugins/orchardcore/skills/orchardcore-menus/SKILL.md -o .claude/skills/orchardcore-menus.md

Drops the SKILL.md into .claude/skills/orchardcore-menus.md. Works with Claude Code, Cursor, and any agent that loads SKILL.md files from .claude/skills/.

Orchard Core Menus

Enable OrchardCore.Menu. A menu is a Menu content item with MenuItemsListPart; its entries are nested content items such as LinkMenuItem, ContentMenuItem, or HtmlMenuItem.

Menu Item Types

Type Purpose URL source
LinkMenuItem Static navigation link Hardcoded LinkMenuItemPart.Url
ContentMenuItem Link derived from a referenced content item Resolved from the referenced item's route
HtmlMenuItem Custom markup inside a menu HTML stored on HtmlMenuItemPart

See orchardcore-navigation for ContentMenuItem recipe examples and for registering menus from a code-first INavigationProvider.

Recipe

Wrap every menu item in a complete root recipe document:

{
  "steps": [
    {
      "name": "Feature",
      "enable": [
        "OrchardCore.Menu",
        "OrchardCore.Widgets",
        "OrchardCore.Layers"
      ]
    },
    {
      "name": "content",
      "data": [
        {
          "ContentItemId": "4j42fxryjcpqkkacmg6cwz3pr5",
          "ContentType": "Menu",
          "DisplayText": "Main Menu",
          "Latest": true,
          "Published": true,
          "MenuPart": {},
          "TitlePart": {
            "Title": "Main Menu"
          },
          "AliasPart": {
            "Alias": "main-menu"
          },
          "MenuItemsListPart": {
            "MenuItems": [
              {
                "ContentItemId": "4j42fxryjcpqkkacmg6cwz3pr6",
                "ContentType": "LinkMenuItem",
                "DisplayText": "Home",
                "LinkMenuItemPart": {
                  "Url": "~/"
                }
              }
            ]
          }
        }
      ]
    }
  ]
}

Render a menu directly from a Liquid theme layout with its alias handle:

{% shape "menu", alias: "alias:main-menu", cache_id: "main-menu", cache_fixed_duration: "00:05:00", cache_tag: "alias:main-menu", cache_context: "user.roles" %}

Menus can be permission-based. Configure permissions on menu items when a link must be visible only to users who can perform the related action. When the menu is cached, include user.roles in cache_context so the output is varied by the current user's roles.

For a custom MenuItem content type, attach MenuItemPermissionPart to enable permission-based visibility. The Content Menu Item also provides a Check content permissions option; when enabled, the item is shown only if the current user has View Content permission for the selected item. Permissions are enabled automatically for new tenants. Run the MenuAddPermissions recipe for an existing tenant that needs the permission part:

{
  "steps": [
    {
      "name": "recipes",
      "Values": [
        {
          "executionid": "MenuAddPermissions",
          "name": "MenuAddPermissions"
        }
      ]
    }
  ]
}

Shape Alternates

The menu's display text is normalized to its differentiator. For a display text of Main Menu, the menu gets Menu__MainMenu and its child shapes use the same differentiator. The generated alternates include:

Shape Examples
Menu Menu__MainMenu
MenuItem MenuItem__MainMenu, MenuItem__LinkMenuItem, MenuItem__MainMenu__LinkMenuItem, plus __level__{n} variants
MenuItemLink Equivalent MenuItemLink__... alternates

Use filenames such as Menu-MainMenu.liquid and MenuItem-MainMenu-LinkMenuItem.cshtml. The differentiator comes from the menu display text, not its alias.

Within a custom menu shape, render the existing menu-item shapes directly:

<nav aria-label="{{ Model.MenuName }}">
  <ul>
    {% for item in Model.Items %}
      {{ item | shape_render }}
    {% endfor %}
  </ul>
</nav>

Render menus directly with the <menu> Razor tag helper or the Menu Liquid shape. Menu content items are not built-in widget types.