Assigns stable logical aliases to Orchard Core content items via AliasPart. Covers configuration, generation, uniqueness, lookups, cache invalidation, Liquid/Razor/GraphQL access, and migrations.
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.
None: SKILL.md is the whole skill.
You are an Orchard Core expert. Generate code and configuration for AliasPart, which assigns a custom logical identifier to a content item without changing its public route.
OrchardCore.Alias feature. Its module dependency is OrchardCore.ContentTypes.AliasPart to a type before assigning aliases. It is an attachable part rather than a route provider.AliasPart.Alias is indexed case-insensitively in AliasPartIndex; aliases are limited to AliasPart.MaxAliasLength which is 735 characters.AliasPartSettings.Pattern is {{ Model.ContentItem.DisplayText | slugify }}.AliasPartOptions.Editable to allow editors to change the generated alias, or GeneratedDisabled to hide editing and generate it from the pattern.-1, -2, and so on to make duplicate generated aliases unique (trimming the base to stay within the length limit). Cloning an item also generates a suffixed alias for the clone.slugify in the pattern when a slug-like value is needed. Generated aliases have line endings removed.AliasPartIndex, not a database constraint, so concurrent creators should still handle validation failures.alias: prefix (IContentHandleManager), the Content Liquid accessors, or the supplied IOrchardHelper Razor extensions.AutoroutePart. An alias is a logical handle and does not create a public URL.{ "steps": [...] } format.sealed modifier, except View Models.{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Alias"
],
"disable": []
}
]
}
Configure a Liquid pattern for generated aliases. The pattern has access to Model and ContentItem.
using OrchardCore.Alias.Models;
using OrchardCore.Alias.Settings;
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.Data.Migration;
namespace MyModule;
public sealed class Migrations : DataMigration
{
private readonly IContentDefinitionManager _contentDefinitionManager;
public Migrations(IContentDefinitionManager contentDefinitionManager)
{
_contentDefinitionManager = contentDefinitionManager;
}
public async Task<int> CreateAsync()
{
await _contentDefinitionManager.AlterTypeDefinitionAsync("Product", type => type
.Creatable()
.Listable()
.WithPart("TitlePart")
.WithPart(nameof(AliasPart), part => part
.WithPosition("2")
.WithSettings(new AliasPartSettings
{
Pattern = "product-{{ ContentItem.DisplayText | slugify }}",
Options = AliasPartOptions.Editable,
})));
return 1;
}
}
| Setting | Type | Behavior |
|---|---|---|
Pattern | string | Liquid template used only when the part alias is empty. |
Options | AliasPartOptions | Editable exposes the alias editor. GeneratedDisabled keeps generation but hides editing. |
Changing a pattern does not retroactively replace non-empty aliases. Clear or change an item's alias deliberately if it must be regenerated.
{
"steps": [
{
"name": "ContentDefinition",
"ContentTypes": [
{
"Name": "Product",
"DisplayName": "Product",
"Settings": {
"ContentTypeSettings": {
"Creatable": true,
"Listable": true
}
},
"ContentTypePartDefinitionRecords": [
{
"PartName": "TitlePart",
"Name": "TitlePart"
},
{
"PartName": "AliasPart",
"Name": "AliasPart",
"Settings": {
"ContentTypePartSettings": {
"Position": "2"
},
"AliasPartSettings": {
"Pattern": "product-{{ ContentItem.DisplayText | slugify }}",
"Options": "Editable"
}
}
}
]
}
]
}
]
}
An explicit alias is retained by AliasPartHandler; it is still validated for uniqueness.
{
"steps": [
{
"name": "Content",
"data": [
{
"ContentItemId": "[js:uuid()]",
"ContentType": "Product",
"DisplayText": "Trail Backpack",
"Latest": true,
"Published": true,
"TitlePart": {
"Title": "Trail Backpack"
},
"AliasPart": {
"Alias": "featured-backpack"
}
}
]
}
]
}
{% assign menu = Content["alias:main-menu"] %} {% comment %} published {% endcomment %}
{% assign draft = Content.Latest["alias:main-menu"] %} {% comment %} latest, including drafts {% endcomment %}
{% assign menu2 = Content.Alias["main-menu"] %} {% comment %} published-only convenience accessor {% endcomment %}
{% contentitem handle: "alias:main-menu", display_type: "Summary" %}
These return nil when nothing matches. There is no alias-specific JavaScript scripting function.
The module adds helpers to IOrchardHelper. Pass either featured-backpack or the backwards-compatible alias:featured-backpack form. GetContentItemByAliasAsync(alias, latest: true) loads the latest version instead of the published one.
@using OrchardCore.ContentManagement
@{
ContentItem? product = await Orchard.GetContentItemByAliasAsync("featured-backpack");
}
@if (product is not null)
{
<span>@product.DisplayText</span>
}
To retrieve only the stable content item ID:
@{
string productId = await Orchard.GetContentItemIdByAliasAsync("alias:featured-backpack");
}
Prefer IContentHandleManager, which composes with every registered IContentHandleProvider, then load the version you need:
using OrchardCore.ContentManagement;
namespace MyModule.Services;
public sealed class MenuProvider
{
private readonly IContentHandleManager _contentHandleManager;
private readonly IContentManager _contentManager;
public MenuProvider(IContentHandleManager contentHandleManager, IContentManager contentManager)
{
_contentHandleManager = contentHandleManager;
_contentManager = contentManager;
}
public async Task<ContentItem?> GetMainMenuAsync()
{
var contentItemId = await _contentHandleManager.GetContentItemIdAsync("alias:main-menu");
return contentItemId is null
? null
: await _contentManager.GetAsync(contentItemId, VersionOptions.Published);
}
}
Query AliasPartIndex directly only when you need index-level filtering. The stored index value is lower-cased, so normalize the lookup value and filter Published or Latest explicitly.
using OrchardCore.Alias.Indexes;
using YesSql;
namespace MyModule.Services;
public sealed class ProductAliasLookup
{
private readonly ISession _session;
public ProductAliasLookup(ISession session)
{
_session = session;
}
public async Task<string?> FindContentItemIdAsync(string alias)
{
if (string.IsNullOrWhiteSpace(alias))
{
return null;
}
var index = await _session
.QueryIndex<AliasPartIndex>(x => x.Alias == alias.ToLowerInvariant() && x.Published)
.FirstOrDefaultAsync();
return index?.ContentItemId;
}
}
AliasPartContentHandleProvider registers the alias: content handle. Published, unpublished, and removed aliases invalidate the alias:<value> cache tag. When caching output resolved through an alias, depend on that tag so the cache is invalidated when the alias changes.
AliasPartIndexProvider records Alias, ContentItemId, Latest, and Published; both the latest and the published version can contribute rows. It removes index records for soft-deleted items, and when AliasPart is removed from the type the stale part data and index row are removed on the next update. Prefer the supplied index and handle provider instead of maintaining a duplicate alias table.
AliasPart also contributes its value to the content indexing pipeline (Lucene, Elasticsearch, Azure AI Search) as a stored keyword, so it is not tokenized as full text.
With GraphQL enabled, types containing AliasPart expose an aliasPart field and an indexed where filter (alias, alias_in, alias_contains, alias_starts_with, and negated forms). Use lowercase filter values.
query {
article(where: { aliasPart: { alias: "support" } }) {
contentItemId
displayText
aliasPart { alias }
}
}
With OrchardCore.Contents enabled, content shapes get Content__Alias__{alias} and Content_Summary__Alias__{alias} alternates; with OrchardCore.Widgets, Widget__Alias__{alias} and Widget_Summary__Alias__{alias}. Dashes are encoded as __, so main-menu gives Content__Alias__main__menu (template files Content-Alias-main-menu.cshtml and Content-Alias-main-menu.Summary.cshtml).
Implement IContentHandleProvider (Order plus GetContentItemIdAsync(handle), returning null when the prefix does not match) and register it with services.AddScoped<IContentHandleProvider, MyHandleProvider>(). Providers run in ascending Order and stop at the first non-empty ID; use a distinct prefix to avoid clashing with alias: or slug:.
Content.Latest[...] / VersionOptions.Latest for drafts (Content.Alias[...] is published-only).Official Orchard Core videos shown on the documentation page:
What SKILL.md sets; muted values are Claude Code's defaults
/orchardcore:orchardcore-aliasfrom 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