Creates and manages navigation menus in Orchard Core CMS, covering menu content types, recipe-based menu creation, menu item types (Link, Content, HTML), permissions, rendering, and caching.
Ships in orchardcore. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Enable OrchardCore.Menu. A menu is a Menu content item with
MenuItemsListPart; its entries are nested content items such as
LinkMenuItem, ContentMenuItem, or HtmlMenuItem.
| 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.
Menus are managed under Content → Menus, which is visible to users who can list Menu content items. The content-type permission Edit_Menu also grants ManageMenu, so users who can edit menus can manage their items.
javascript: are replaced with an empty URL on a rendering-only copy; stored content is not changed.HtmlMenuItemPart stores its HTML exactly as authored and sanitizes it on a cloned item at render time. Like HtmlBodyPart, it does not execute Liquid.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": "~/"
}
}
]
}
}
]
}
]
}
The menu editor finds a menu item by its ContentItemId, so every menu item (at any depth) needs one that is unique in its menu. For an item without one (for example from a recipe that omits it), Edit and Delete return Not Found; before 4.0 they matched the menu itself and failed with an ArgumentNullException or NullReferenceException. Nothing repairs such items automatically, so always set ContentItemId in recipes, either a fixed id or "[js: uuid()]":
{
"steps": [
{
"name": "content",
"data": [
{
"ContentItemId": "4footermenu0000000000000a",
"ContentType": "Menu",
"DisplayText": "Footer Menu",
"Latest": true,
"Published": true,
"TitlePart": { "Title": "Footer Menu" },
"AliasPart": { "Alias": "footer-menu" },
"MenuItemsListPart": {
"MenuItems": [
{
"ContentItemId": "[js: uuid()]",
"ContentType": "LinkMenuItem",
"DisplayText": "Contact",
"LinkMenuItemPart": { "Url": "~/contact" }
}
]
}
}
]
}
]
}
In the menu editor each item row (MenuItem.Admin) adds its Edit, Add and Delete buttons to its Actions zone and renders them through AdminListActions, so they follow Settings → Admin → Appearance → Actions layout (Buttons or one ellipsis Menu) like admin list rows. An override of MenuItem.Admin.cshtml should keep rendering @await DisplayAsync(await Factory.CreateAdminListActionsAsync((IShape)Model)) (see orchardcore-admin-lists).
OrchardCore.Menu AdminController Create/Edit) shows Cancel and a Save menu item button, rendered by the MenuItemEditorActions shape (property MenuContentItemId), instead of the Publish/Delete actions of a content item. Override MenuItemEditorActions.cshtml to change them.ContentItem: CreatingAsync/CreatedAsync on create and UpdatingAsync/UpdatedAsync on edit (Created/Updated only when the editor is valid), so ContentHandlerBase implementations and part handlers can set or validate menu item data. No publish or remove events are raised for the item itself.using OrchardCore.ContentManagement.Handlers;
public sealed class LinkMenuItemAuditHandler : ContentHandlerBase
{
public override Task UpdatedAsync(UpdateContentContext context)
{
if (context.ContentItem.ContentType == "LinkMenuItem")
{
// React to the edited menu item before it is merged into its menu.
}
return Task.CompletedTask;
}
}
Register it with services.AddScoped<IContentHandler, LinkMenuItemAuditHandler>();.
MenuItemPermissionPart (Link and HTML menu items) is a bootstrap-select <select multiple data-permission-picker> with live search and selected tags; it no longer uses Vue. The menu-permission-picker style, the menu-permission-picker-created event, the permission-picker JavaScript localizations and MenuJSLocalizer were removed, so update overrides of MenuItemPermissionPart.Edit.cshtml from the new view (the posted values are unchanged).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"
}
]
}
]
}
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.
Import it with @addTagHelper *, OrchardCore.Menu, then:
<menu alias="alias:main-menu" cache-id="main-menu" cache-fixed-duration="00:05:00" cache-tag="alias:main-menu" cache-context="user.roles" />
| Attribute | Description |
|---|---|
alias | Alias of the menu to render, e.g. alias:main-menu. |
cache-id | Unique identifier for caching the output. |
cache-context | Cache contexts, e.g. user.roles for permission-based items. |
cache-tag | Tags used to invalidate the cached entry. |
cache-fixed-duration, cache-sliding-duration | Cache expiration, e.g. 00:05:00. |
The Liquid shape tag accepts the same values with underscores (cache_id, cache_context, cache_tag, cache_fixed_duration, cache_sliding_duration).
Menus are usually cached, so mark the current item client-side with the module's script, which adds a class (default active) to the parent of the link matching the current URL. In 4.0 it is a plain function, window.activateLinks(container, options, callback), not a jQuery plugin:
<script asp-src="~/OrchardCore.Menu/Scripts/activate-links.min.js" debug-src="~/OrchardCore.Menu/Scripts/activate-links.js" at="Foot"></script>
<script at="Foot">
document.addEventListener('DOMContentLoaded', function () {
activateLinks(document.getElementById('mainNav'), { selector: 'a', traverse: 2 }, function (items) {
items.forEach(function (item) { item.closest('.has-treeview')?.classList.add('menu-open'); });
});
});
</script>
traverse removes up to that many URL segments to activate a less specific link (e.g. /todo-items while on /todo-items/Create); selector targets a child of the link's parent.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
orchard-core, navigation-menus, cms-menus, menu-items, recipe
/orchardcore:orchardcore-menusfrom orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin orchardcore140 skills in this plugin
/orchardcore-adminGuidance for the Orchard Core admin panel, including admin controllers and routes, admin menu registration with AdminNavigationProvider, ocat editor forms grouped in cards, admin pages rendering Model.Editor, the UI text casing standard, TheAdmin layout and menu colors, admin branding, the Navbar shape, the Ctrl+K quick navigation palette and QuickNavigationSource, AdminSettings such as MenuBehavior, ShowBreadcrumb, DisplayQuickNavigation, DisplayTitlesInTopbar and ActionsLayout, the AdminDashboard shape, settings pages, and admin filters and zones. Use this skill when requests mention the Orchard Core admin panel, TheAdmin, admin controllers, admin menu registration, an icon on an admin menu item, the AdminSettings recipe step, quick navigation, navigation menu behavior, the admin URL prefix, UI text casing. Strong matches include OrchardCore.Admin, AdminSettings, AdminPermissions, AdminOptions, AdminAttribute, SiteDisplayDriver, IDisplayManager./orchardcore-admin-dashboardSkill for creating admin dashboard widgets in Orchard Core. Covers the DashboardWidget stereotype, DashboardPart position and sizing, the built-in HtmlDashboardWidget, ContentsMetadata and ContentsTags widget types, custom widget content types via recipe or migration, arranging widgets in Manage Dashboard mode, widget template customization, provisioning widgets with recipes, dashboard permissions, the DashboardBreadcrumbProvider Dashboard ancestor, and the AdminDashboardContent shape used when the feature is disabled. Use this skill when requests mention Orchard Core Admin Dashboard, Create and Configure Dashboard Widgets, Enabling Admin Dashboard, Widget Configuration Properties, dashboard widget recipes, Dashboard breadcrumb, or related implementation, setup, or troubleshooting work. Strong matches include OrchardCore.AdminDashboard, DashboardPart, DashboardBreadcrumbProvider, AccessAdminDashboard, ManageAdminDashboard.Other plugins' skills for the same job