Configures layers and conditional widget visibility in Orchard Core CMS. Covers layer creation, rules/conditions, zone-based display, recipe steps, JavaScript conditions, URL rules, and the ManageLayers permission.
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 configuration and code for managing layers and conditional widget visibility in Orchard Core.
OrchardCore.Layers module and control when widgets are displayed in theme zones.true.Layers with an Add layer button at its top (the LayersCreateButton shape, passed as AdminListContext.Actions); the old Add button under the list is gone. Checking a layer highlights its widgets in the zones beside the list.AdminListActions, so they follow Settings → Admin → Appearance → Actions layout (Buttons or one ellipsis Menu), like admin list rows.Model.Editor built by LayerEditDisplayDriver (DisplayDriver<LayerEditViewModel>): a General card and, on edit, a Rules card; another module can add a card with its own driver of LayerEditViewModel. They and the condition editor put Cancel first and Create/Save (btn-primary) last in the bottom action bar.LayerSiteSettingsDisplayDriver) is in a Zones card.All (AND) and Any (OR) condition groups.Always layer uses a Boolean condition set to true, so widgets on this layer always render.OrchardCore.Layers and OrchardCore.Widgets features for full widget/layer support; Layers enables OrchardCore.Rules.ManageLayers permission.All/Any group) with no conditions evaluates to false; use a Boolean condition set to true for "always".{ "steps": [...] }.sealed modifier except View Models.{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Layers",
"OrchardCore.Widgets"
],
"disable": []
}
]
}
| Condition | Description |
|---|---|
Homepage | True when the current page is the site homepage |
Is anonymous | True when the current user is not authenticated |
Is authenticated | True when the current user is authenticated |
Role | Evaluates the current user's roles against a value |
Url | Evaluates the current URL against a value |
Culture | Evaluates the current UI culture against a value |
Content Type | Evaluates the currently displayed content type against a value |
Javascript | A custom script condition written in JavaScript |
All | Condition group where all nested conditions must be true (AND logic) |
Any | Condition group where at least one nested condition must be true (OR logic) |
Boolean | A simple true/false condition |
The Always layer uses a Boolean condition set to true. Widgets on this layer are always visible (e.g., site footer, header navigation).
Uses the Homepage condition so widgets only display on the homepage (e.g., hero banners, featured content).
Uses the Is authenticated condition so widgets display only for logged-in users (e.g., dashboard links, user menus).
Uses the Is anonymous condition so widgets display only for unauthenticated visitors (e.g., login prompts, signup banners).
Zones must be declared as sections in the theme layout. Widgets are rendered in matching zones.
{% render_section "Header", required: false %}
{% render_section "Content", required: false %}
{% render_section "Footer", required: false %}
@await RenderSectionAsync("Header", required: false)
@await RenderSectionAsync("Content", required: false)
@await RenderSectionAsync("Footer", required: false)
Set available zone names in Settings > Zones in the admin. Common zone names include:
HeaderNavigationBeforeContentContentAfterContentSidebarFooter{
"steps": [
{
"name": "Settings",
"LayerSettings": {
"Zones": [ "Header", "Content", "Footer" ]
}
}
]
}
Name must match the registered condition factory name (the condition class
name). Conditions nested inside an All/Any group also need $type
(for example "OrchardCore.Rules.Models.UrlCondition, OrchardCore.Rules"),
which the All Layers deployment step emits. Supplying LayerRule for an
existing layer replaces its whole condition list, and an unknown condition name
fails the step without saving.
{
"steps": [
{
"name": "Layers",
"Layers": [
{
"Name": "Always",
"Description": "Widgets on this layer are always displayed.",
"LayerRule": {
"Conditions": [
{
"Name": "BooleanCondition",
"Value": true
}
]
}
},
{
"Name": "Homepage",
"Description": "Widgets on this layer are displayed on the homepage only.",
"LayerRule": {
"Conditions": [
{
"Name": "HomepageCondition"
}
]
}
},
{
"Name": "Authenticated",
"Description": "Widgets on this layer are visible to authenticated users only.",
"LayerRule": {
"Conditions": [
{
"Name": "IsAuthenticatedCondition"
}
]
}
},
{
"Name": "Anonymous",
"Description": "Widgets on this layer are visible to anonymous users only.",
"LayerRule": {
"Conditions": [
{
"Name": "IsAnonymousCondition"
}
]
}
}
]
}
]
}
{
"steps": [
{
"name": "Content",
"data": [
{
"ContentItemId": "[js:uuid()]",
"ContentType": "HtmlWidget",
"DisplayText": "Footer Copyright",
"Latest": true,
"Published": true,
"LayerMetadata": {
"Layer": "Always",
"Zone": "Footer",
"Position": 10
},
"HtmlBodyPart": {
"Html": "<p>© 2025 My Company. All rights reserved.</p>"
}
}
]
}
]
}
Combine conditions with All (AND) or Any (OR) groups for complex rules:
Use an All group with both Homepage and Is authenticated conditions:
Use an Any group with a Homepage condition and a Role condition set to Administrator:
Administrator.Implement custom layer conditions by following the Rules module pattern. Refer to the OrchardCore.Rules module for guidance on creating custom condition evaluators.
The Javascript condition evaluates an expression that must convert to a
Boolean. Layers adds these global methods:
| Function | Behavior |
|---|---|
isHomepage() | The request path is the tenant home page. |
isAnonymous() / isAuthenticated() | Authentication state of the current user. |
isInRole(role) | Role name, case-insensitive. |
url(pattern) | Case-insensitive path match; a trailing * makes it a prefix match. |
culture(name) | Current culture or its parent culture, case-insensitive. |
// Show widgets on the blog section for signed-in users.
isAuthenticated() && url("/blog*")
ScriptPreparationException),
runtime exceptions, and non-Boolean results are reported as validation
messages instead of failing the request.const declarations from one layer's condition are not visible to another,
so write each condition as a self-contained expression.HttpContext.RequestAborted; a script still
running when the client disconnects is stopped with an
OperationCanceledException. Configure time or statement limits through
IOptions<Jint.Options> (see orchardcore-scripting).Url, Role, Culture, and Homepage conditions
over JavaScript when they express the rule; they are faster and easier to
audit.OrchardCore.Layers and OrchardCore.Widgets features.Widget stereotype.true.var or const declared in one could break another. Each condition is
now isolated; remove any reliance on values declared by another layer.LayersCreateButton). UI tests and overrides of Views/Admin/Index.cshtml that looked for the old link must update.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/orchardcore:orchardcore-layersfrom 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