Implements and customizes Orchard Core 4.0 breadcrumbs on admin screens and front-end views. Covers tag helpers, IBreadcrumbProvider, shape alternates, and Breadcrumb.cshtml overrides.
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.
Orchard Core 4.0 renders admin page titles as a named trail with an explicit current-page title, e.g. Dashboard › Manage Content › Edit Article. The Breadcrumb and BreadcrumbItem shapes live in the always-enabled OrchardCore.Navigation module; the tag helpers live in OrchardCore.Navigation.Core. No feature needs to be enabled and inline authoring needs no provider registration.
<breadcrumb> declares the trail name and the current page title. Both are required.<breadcrumb-item> child is an ancestor, never the current page.IBreadcrumbProvider in DI registration order on the same ancestor list, keeps the resulting order (no sorting), then always appends the title as the final, unlinked current node with the fixed Id = "Title".<h1> below the trail and registers it as a <title> segment, so the view must not render its own heading.INavigationProvider is unrelated: it builds menus, not breadcrumb trails.Import the tag helpers once in the module's Views/_ViewImports.cshtml (reference the OrchardCore.Navigation.Core package or project):
@addTagHelper *, OrchardCore.Navigation.Core
Put the helper in the Title zone, replacing the old <h1> and any @RenderTitleSegments(...) call for the same title:
<zone Name="Title">
<breadcrumb name="RecordsEdit" title="@T["Edit {0}", Model.Record.Name]">
<breadcrumb-item id="Records" action="Index" controller="Record" area="My.Module"
permission="@MyPermissions.ManageRecords.Name">@T["Records"]</breadcrumb-item>
</breadcrumb>
</zone>
A page with no ancestors (or whose ancestors come only from providers) still declares both attributes:
<zone Name="Title">
<breadcrumb name="Records" title="@T["Records"]" />
</zone>
Rendering it in the Title zone keeps the Display titles in the top bar admin setting working; TheAdmin's own Breadcrumb.cshtml moves the trail into the Breadcrumbs zone above the title. A trail that should not carry the page title goes in the Breadcrumbs zone with heading="" (and page-title="false" when the page registers its browser title itself).
name and ancestor id, in PascalCase without separators (ContentsEdit, Records), so alternate file names stay readable.Contents for both. Content screens use Contents, ContentsCreate, and ContentsEdit.ContentsEdit trail of a listable content type includes the type as a ContentType item between Manage Content and the edit title: it links to the request's returnUrl when that is a local URL, otherwise to the content items list filtered to that type (link disabled when the user can't list it). Non-listable types keep the shorter trail. Target it in a provider or alternate with the ContentType id (for example BreadcrumbItem-ContentsEdit-ContentType.DetailAdmin.cshtml).breadcrumb-{name} CSS class, shape alternates, and Dashboard deduplication. No constants class, data attribute, or breadcrumb manager is needed.<breadcrumb> Attributes| Attribute | Type | Behavior |
|---|---|---|
name | string | Required stable trail name. |
title | Microsoft.AspNetCore.Html.IHtmlContent | Required and non-null, including LocalizedHtmlString. HtmlString.Empty suppresses heading and browser-title text but still leaves the current node in a visible trail. |
heading | string | Heading tag rendered below the trail. Defaults to h1 on admin requests and to none on the front end. heading="" renders none. |
page-title | bool | Registers the title as a <title> segment. Defaults to true everywhere. |
display-type | string | Defaults to DetailAdmin on admin requests and Detail elsewhere; becomes an alternate of every shape the trail renders. |
Pass the Razor localizer result directly. Wrap anything that is not already IHtmlContent with OrchardCore.DisplayManagement.Html.HtmlContentString, which encodes untrusted strings when written:
| Value in the view | Title expression |
|---|---|
| HTML-localized label | title="@T["Edit {0}", record.Name]" |
| Plain model string | title="@(new HtmlContentString(Model.DisplayText ?? string.Empty))" |
LocalizedString (IStringLocalizer) | title="@(new HtmlContentString(localizedTitle.Value ?? string.Empty))" |
DataLocalizedString (IDataLocalizer) | title="@(new HtmlContentString(dataTitle.Value ?? string.Empty))" |
| Intentionally empty | title="@Microsoft.AspNetCore.Html.HtmlString.Empty" |
Add @using OrchardCore.DisplayManagement.Html for the short form. Never extract T[...].Value or use Html.Raw as a conversion.
The helper renders the title once with WriteTo(writer, HtmlEncoder.Default), HTML-decodes it once, then safely encodes that plain text for the heading, the current node, and the browser title. Output is always text-only: IHtmlContent does not allow markup in titles, and a literal & wrapped with HtmlContentString stays literal.
<breadcrumb-item> AttributesThe child content is the ancestor text, e.g. @T["Records"] (HTML-decoded after Razor evaluates it, then re-encoded on output).
| Attribute | Type | Behavior |
|---|---|---|
id | string | Stable node ID for shape alternates (not an HTML id). |
action, controller, area | string | MVC route target; prefer these over hand-built URLs. |
route-* | string | Extra route values, e.g. route-id="@record.Id". |
route-values | IDictionary<string, string> | Extra route values as a dictionary (not an anonymous object or RouteValueDictionary). |
url | string | Direct link; ignored when action is set. |
permission | string | Permission name stored as BreadcrumbItem.PermissionName; unknown names are ignored. |
resource | object | Resource the permission is evaluated against. |
link-enabled | bool | Defaults to true; false renders the ancestor as plain text. |
There is no position attribute: BreadcrumbItem has no Position and does not implement IPositioned. Unauthorized ancestors, ancestors with link-enabled="false", and ancestors without a target stay visible as plain text; permissions control links, not node visibility. Named permissions are resolved only when finalizing visible ancestor links after providers run. Link checks are not endpoint security: keep authorization on the target action.
Link back through the real parent entity, read from the view model or loaded with an existing service injected into Razor (not a breadcrumb-specific service):
@inject OrchardCore.ContentManagement.IContentManager ContentManager
@{
var parent = await ContentManager.GetAsync(Model.ParentContentItemId);
}
<zone Name="Title">
<breadcrumb name="RecordsEdit" title="@T["Edit {0}", Model.Record.Name]">
<breadcrumb-item id="Records" action="Index" controller="Record" area="My.Module">@T["Records"]</breadcrumb-item>
<breadcrumb-item id="Parent" action="Edit" controller="Record" area="My.Module"
route-id="@parent.ContentItemId"
permission="@MyPermissions.ManageRecords.Name"
resource="@parent">@T["Edit {0}", parent.DisplayText]</breadcrumb-item>
</breadcrumb>
</zone>
IBreadcrumbProviderUse a provider for shared or cross-module ancestor changes; keep screen-specific nodes in the owning view.
public interface IBreadcrumbProvider
{
ValueTask BuildBreadcrumbAsync(BreadcrumbContext context);
}
BreadcrumbContext (namespace OrchardCore.Navigation) exposes read-only properties; its constructor is BreadcrumbContext(string name, string title, List<BreadcrumbItem> items, ViewContext viewContext, bool showTrail).
| Property | Type | Use |
|---|---|---|
Name | string | Literal trail name; filter on it explicitly. |
Title | string | Normalized plain-text title. Providers cannot change the current node. |
Items | List<BreadcrumbItem> | Shared mutable ancestor list: add, insert, remove, reorder, or edit. The current node is not in it. |
ViewContext | ViewContext | Request context, e.g. AdminAttribute.IsApplied(context.ViewContext.HttpContext). |
ShowTrail | bool | Always true in helper-created contexts; hidden trails never invoke providers. |
using Microsoft.Extensions.Localization;
using OrchardCore.Admin;
using OrchardCore.Navigation;
public sealed class RecordsBreadcrumbProvider : IBreadcrumbProvider
{
private readonly IStringLocalizer S;
public RecordsBreadcrumbProvider(IStringLocalizer<RecordsBreadcrumbProvider> localizer)
{
S = localizer;
}
public ValueTask BuildBreadcrumbAsync(BreadcrumbContext context)
{
if (!AdminAttribute.IsApplied(context.ViewContext.HttpContext) ||
!context.Name.StartsWith("Records", StringComparison.Ordinal) ||
context.Name == "Records" ||
context.Items.Any(item => item.Id == "Records"))
{
return ValueTask.CompletedTask;
}
context.Items.Insert(0, new BreadcrumbItem
{
Id = "Records",
Text = S["Records"].Value,
RouteValues = new() { ["area"] = "My.Module", ["controller"] = "Record", ["action"] = "Index" },
PermissionName = "ManageRecords",
});
return ValueTask.CompletedTask;
}
}
services.AddBreadcrumbProvider<RecordsBreadcrumbProvider>();
AddBreadcrumbProvider<T>() registers a scoped service with TryAddEnumerable; providers run sequentially in registration order and see earlier changes.Text to a plain string (not encoded HTML). Describe links with Url or RouteValues, PermissionName or Permissions (accepts Permission objects), Resource, and LinkEnabled. Do not set or rely on Href or IsCurrent; the helper finalizes them after providers.Name or request, never by comparing localized title text.Enabling OrchardCore.AdminDashboard registers OrchardCore.AdminDashboard.Services.DashboardBreadcrumbProvider. On admin requests it inserts a localized Dashboard ancestor (ID Dashboard) at index 0, unless context.Name == "Dashboard" or an ancestor already has that ID. Its Url is "~/" + AdminOptions.AdminUrlPrefix and its Permissions list holds the static OrchardCore.AdminDashboard.Permissions.AccessAdminDashboard permission, so a denied user sees it as plain text. It never changes front-end trails or the title, and later providers can move it. The dashboard page itself uses <breadcrumb name="Dashboard" title="@T["Dashboard"]" />.
OrchardCore.Lists registers OrchardCore.Lists.Services.ContainerBreadcrumbProvider. On the admin ContentsEdit and ContentsCreate trails of an item that belongs to a list (a blog post in a blog), it adds the container as a Container item, for example Dashboard / Manage Content / Blog / New Blog Post:
ListPart.ContainerId query string on create and from the latest version's ContainedPart.ListContentItemId on edit; the published container is preferred, then its latest version.DisplayText, or, when empty, its content type display name localized with IDataLocalizer (DataLocalizationContext.ContentType), else the technical type name.Display action (OrchardCore.Contents Admin/Display) with Resource = container and CommonPermissions.ViewContent, so a user who can't view it sees plain text.ContentType item when present, otherwise it is appended; it does nothing when an item with the Container id already exists, so a provider or view can supply its own.Container id (for example BreadcrumbItem-ContentsEdit-Container.DetailAdmin.cshtml).Show breadcrumb under Settings → Admin (AdminSettings.ShowBreadcrumb, default true) hides admin trails only:
{
"steps": [
{
"name": "settings",
"AdminSettings": {
"ShowBreadcrumb": false
}
}
]
}
When hidden, the helper never evaluates its child content, never resolves or runs providers (Dashboard included), creates no BreadcrumbContext or items, generates no URLs, checks no permissions, and renders no shapes. It renders only the title, directly in a heading with the oc-breadcrumb-title class, and registers the browser title according to heading and page-title; with heading="" and page-title="false" it still requires a non-null title but does not even render it. Breadcrumb template overrides therefore do not apply to the hidden state. Attribute expressions (T[...], HtmlContentString wrappers) and Razor code or model lookups outside the child content still run.
All visibility decisions belong to the tag helper. Views must not read AdminSettings.ShowBreadcrumb or guard lookups, ancestor declarations, or the helper on it. Front-end trails ignore the setting.
The same helpers work in a front-end theme with display type Detail and no heading by default:
@using OrchardCore.DisplayManagement.Html
<breadcrumb name="ProductDetails" title="@(new HtmlContentString(Model.Product.Name ?? string.Empty))" page-title="false">
<breadcrumb-item id="Catalog" action="Index" controller="Catalog" area="My.Module">@T["Catalog"]</breadcrumb-item>
</breadcrumb>
A visible front-end trail always evaluates its children and providers, even with no heading and page-title="false". Providers see front-end trails too unless they filter on the request, and the Dashboard provider leaves them unchanged.
| Shape | Alternates (least to most specific) |
|---|---|
Breadcrumb | Breadcrumb__[Name], Breadcrumb_[DisplayType], Breadcrumb_[DisplayType]__[Name], e.g. Breadcrumb-ContentsEdit.cshtml, Breadcrumb.DetailAdmin.cshtml, Breadcrumb-ContentsEdit.DetailAdmin.cshtml |
BreadcrumbItem | BreadcrumbItem__[Name], BreadcrumbItem__[Id], BreadcrumbItem__[Name]__[Id], then the same three with the display type, e.g. BreadcrumbItem-ContentsEdit-Title.DetailAdmin.cshtml |
BreadcrumbItem-Title.cshtml, BreadcrumbItem-[Name]-Title.cshtml, BreadcrumbItem-Title.[DisplayType].cshtml, BreadcrumbItem-[Name]-Title.[DisplayType].cshtml.. encodes to _ and - to __.Breadcrumb.cshtml renders the <ol class="breadcrumb"> trail and the heading together, so it is the one template to override to rearrange them. Template Breadcrumb.DetailAdmin.cshtml to restyle only the admin, or Breadcrumb.Detail.cshtml for the front end.oc-breadcrumb and breadcrumb-{name} classes and is plain Bootstrap markup, so --bs-breadcrumb-* custom properties restyle it without a template.Breadcrumb exposes Name, Heading, Title, and ShowTrail; BreadcrumbItem (BreadcrumbItemViewModel) exposes Name, Item (the BreadcrumbItem), Breadcrumb (the parent shape), Text, Href, IsCurrent, and Level. Render text with @Model.Text or TagBuilder.InnerHtml.Append(...), never Html.Raw or a second decode, and link only when Href is set rather than rebuilding links from route values.<li class="breadcrumb-item">, adding active and aria-current="page" to the current node. Classes a provider adds to BreadcrumbItem.Classes are rendered on that <li>.[Id] alternates exist only for nodes with an ID. On the Dashboard page, BreadcrumbItem-Dashboard-Title.cshtml restyles its current node; BreadcrumbItem-Dashboard.cshtml matches both the Dashboard ancestor (by ID) and every node of the Dashboard trail (by name)..DetailAdmin or .Detail template only when the admin and the front end really differ.See references/breadcrumbs-examples.md for the full alternate tables, a title-above-trail override, and the low-level shape API.
HtmlString.Empty is valid and still leaves a current node in a visible trail.Title, and providers can neither remove nor replace it.<h1> and RenderTitleSegments call when the helper owns the title.AdminSettings.ShowBreadcrumb or wrap lookups or markup in setting-dependent branches.route-values type. It takes IDictionary<string, string>, not an anonymous object or RouteValueDictionary.permission and link-enabled only control whether an ancestor is rendered as a link.Breadcrumb override cannot change the directly rendered heading of a hidden admin trail.<zone Name="Title"><h1>@RenderTitleSegments(T["Edit Record"])</h1></zone>.<zone Name="Title"><breadcrumb name="RecordsEdit" title="@T["Edit Record"]">...</breadcrumb></zone>, with @addTagHelper *, OrchardCore.Navigation.Core in _ViewImports.cshtml. Remove the old heading and title segment call to avoid duplicates.Breadcrumb.cshtml or the BreadcrumbItem-Title alternates.orchardcore-admin for admin controllers, views, and settings.orchardcore-admin-lists for list pages whose trail name matches the list name.orchardcore-admin-edit-views for the edit pages and forms below the title.orchardcore-navigation for INavigationProvider menus and pager shapes.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
orchard-core, breadcrumbs, navigation, admin-ui, tag-helpers
/orchardcore:orchardcore-breadcrumbsfrom 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