Builds Blazor CMS applications with Orchard Core, covering SSR and Server Interactive rendering, Razor class library structure, content integration via IContentHandleManager/IContentManager, sanitized HTML with BodyAspect, DI in Blazor pages, SEO, alias handling, and multi-tenant base URLs.
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 building Blazor CMS applications powered by Orchard Core, including SSR, Server Interactive rendering, content integration, and multi-tenant support.
.razor files must live in a separate Razor class library project, not directly in the Orchard Core web project. Adding .razor files to Orchard Core modules is not supported.Microsoft.AspNetCore.App as a FrameworkReference to access ASP.NET Core–specific APIs.AddOrchardCms() using .ConfigureServices() and .Configure() — do not register them outside of the Orchard Core pipeline.IContentHandleManager to resolve a content item ID from an alias handle, then use IContentManager to load the content item.IContentManager.PopulateAspectAsync<BodyAspect>(contentItem) to extract rendered body HTML from content items. In Orchard Core 4.0 HTML and Markdown are stored exactly as authored and sanitized only when rendered, so BodyAspect returns sanitized HTML (when SanitizeHtml is enabled) while raw HtmlBodyPart.Html / MarkdownBodyPart.Markdown values are unsanitized source. Never inject raw part values as MarkupString.HtmlBodyPart, MarkdownBodyPart, HtmlField and MarkdownField no longer execute Liquid; use LiquidPart or LiquidField for templated content.ISiteService.GetSiteSettingsAsync() for read-only site-level settings like SiteName; use LoadSiteSettingsAsync() before modifying and saving site settings.@attribute [StreamRendering] to Blazor pages to enable streaming rendering for async content loading.<base href> tag using NavigationManager.BaseUri to reflect tenant-specific URL prefixes./tenant01/) and its own content, content types, and settings.@rendermode="RenderMode.InteractiveServer" on individual components to enable interactivity via SignalR within an otherwise SSR page.builder.Services.AddRazorPages() separately — AddOrchardCms() handles this internally.A typical Blazor + Orchard Core solution consists of two projects:
MySolution/
├── MySolution.sln
├── BlazorCms/ # Orchard Core web project
│ ├── BlazorCms.csproj
│ └── Program.cs
└── BlazorLib/ # Razor class library (Blazor components)
├── BlazorLib.csproj
├── App.razor
├── App.razor.css
├── Routes.razor
├── _Imports.razor
├── Layout/
│ ├── MainLayout.razor
│ ├── MainLayout.razor.css
│ ├── NavMenu.razor
│ └── NavMenu.razor.css
├── Pages/
│ ├── Home.razor
│ └── Content.razor
└── Components/
└── InteractiveButton.razor
mkdir BlazorSolution
cd BlazorSolution
dotnet new sln
dotnet new occms -o BlazorCms
dotnet sln add ./BlazorCms
dotnet new razorclasslib -f net11.0 -o BlazorLib
dotnet sln add ./BlazorLib
dotnet add ./BlazorCms/BlazorCms.csproj reference ./BlazorLib/BlazorLib.csproj
The Razor class library must include a FrameworkReference to Microsoft.AspNetCore.App and reference the OrchardCore.ContentManagement package for content APIs:
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net11.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="OrchardCore.ContentManagement" Version="3.*" />
</ItemGroup>
</Project>
Register Blazor services and map components within the Orchard Core pipeline using ConfigureServices and Configure:
using BlazorLib;
public sealed class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
builder.Services
.AddOrchardCms()
.ConfigureServices(services =>
{
services.AddRazorComponents()
.AddInteractiveServerComponents();
})
.Configure((app, routes, services) =>
{
app.UseStaticFiles();
app.UseAntiforgery();
routes.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
});
var app = builder.Build();
app.UseOrchardCore();
app.Run();
}
}
The root Blazor component that renders the HTML document. For multi-tenant support, dynamically set <base href> using NavigationManager:
@inject NavigationManager NavManager
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href=@_baseUrl />
<link rel="stylesheet" href="OrchardCore.Resources/Styles/bootstrap.min.css" />
<link rel="stylesheet" href="_content/BlazorLib/BlazorLib.bundle.scp.css" />
<HeadOutlet />
</head>
<body>
<Routes />
<script src="_framework/blazor.web.js"></script>
</body>
</html>
@code
{
protected string _baseUrl = "/";
protected override void OnParametersSet()
{
base.OnParametersSet();
_baseUrl = NavManager.BaseUri;
}
}
<Router AppAssembly="typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)" />
<FocusOnNavigate RouteData="routeData" Selector="h1" />
</Found>
</Router>
@using System.Net.Http
@using System.Net.Http.Json
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using BlazorLib
@using OrchardCore
@using OrchardCore.ContentManagement
@using OrchardCore.Settings
@inherits LayoutComponentBase
<div class="page">
<div class="sidebar">
<NavMenu />
</div>
<main>
<div class="top-row px-4">
<a href="https://docs.orchardcore.net/" target="_blank">Learn Orchard</a>
</div>
<article class="content px-4">
@Body
</article>
</main>
</div>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<div class="top-row ps-3 navbar navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="">BlazorCMS</a>
</div>
</div>
<input type="checkbox" title="Navigation menu" class="navbar-toggler" />
<div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
<nav class="flex-column">
<div class="nav-item px-3">
<NavLink class="nav-link" href="home" Match="NavLinkMatch.All">
<span class="bi bi-house-door-fill-nav-menu" aria-hidden="true"></span> Home
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="content/my-alias">
<span class="bi bi-list-nested-nav-menu" aria-hidden="true"></span> My Content
</NavLink>
</div>
</nav>
</div>
For multi-tenant compatibility, use /home instead of / to avoid conflicting with Orchard Core's root route (used for setup and tenant routing):
@page "/home"
<PageTitle>Home</PageTitle>
<h1>Hello, Orchard!</h1>
Welcome to your new Blazor CMS app.
Use IContentHandleManager to resolve the content item ID from an alias, then IContentManager to load the content item:
@page "/content/{alias}"
@attribute [StreamRendering]
@using OrchardCore.ContentManagement.Models
@inject IContentHandleManager HandleManager
@inject IContentManager ContentManager
@inject ISiteService SiteService
@if (ContentItem == null)
{
<p><em>Loading...</em></p>
}
else
{
<PageTitle>@ContentItem.DisplayText - @Site?.SiteName</PageTitle>
<h1>@ContentItem.DisplayText</h1>
@((MarkupString)Markup)
}
@code
{
[Parameter]
public string Alias { get; set; }
protected ContentItem? ContentItem { get; set; }
protected string Markup { get; set; } = string.Empty;
protected ISite? Site { get; set; }
protected override async Task OnInitializedAsync()
{
Site = await SiteService.GetSiteSettingsAsync();
}
protected override async Task OnParametersSetAsync()
{
var id = await HandleManager.GetContentItemIdAsync($"alias:{Alias}");
if (id != null)
{
ContentItem = await ContentManager.GetAsync(id, VersionOptions.Published);
if (ContentItem != null)
{
var bodyAspect = await ContentManager.PopulateAspectAsync<BodyAspect>(ContentItem);
Markup = bodyAspect.Body?.ToString() ?? string.Empty;
}
}
}
}
| Service | Description |
|---|---|
IContentHandleManager | Resolves a content item ID from a handle string (e.g., alias:my-slug). |
IContentManager | Full content item CRUD API. Use GetAsync(id, VersionOptions) to load content. |
ISiteService | Access site-level settings such as SiteName, BaseUrl, and TimeZoneId. |
BodyAspect | Aspect that provides the rendered body HTML of a content item. Populated via PopulateAspectAsync. |
NavigationManager | Blazor's built-in service for navigation. Use BaseUri to get the tenant-specific base URL. |
| Pattern | Code |
|---|---|
| Load by alias | var id = await HandleManager.GetContentItemIdAsync($"alias:{alias}"); |
| Load by content item ID | var item = await ContentManager.GetAsync(contentItemId, VersionOptions.Published); |
| Load latest draft | var item = await ContentManager.GetAsync(contentItemId, VersionOptions.Latest); |
| Get rendered body HTML | var body = await ContentManager.PopulateAspectAsync<BodyAspect>(item); |
| Get site settings | var site = await SiteService.GetSiteSettingsAsync(); |
To add interactivity to specific components within an SSR page, use @rendermode="RenderMode.InteractiveServer". This establishes a SignalR connection for that component.
<!-- InteractiveButton.razor in Components/ folder -->
<h3>Interactivity Test</h3>
<button class="btn-primary" @onclick="Clicked">Click me</button>
<hr />
@_feedback
@code {
protected string? _feedback;
protected void Clicked()
{
_feedback = $"Clicked at {DateTime.Now.ToLocalTime()}";
}
}
Use the component in a page with the interactive render mode:
@page "/demo"
<h1>Interactive Demo</h1>
<BlazorLib.Components.InteractiveButton @rendermode="RenderMode.InteractiveServer" />
Orchard Core multi-tenancy assigns each tenant a unique URL prefix. The Blazor app must adapt its <base href> accordingly.
Tools > Features and enable the Tenants feature.Multi-Tenancy > Tenants and add a new tenant:
FirstTenanttenant01| Method | Code |
|---|---|
NavigationManager | NavManager.BaseUri — simplest approach, returns the full base URI including tenant prefix. |
HttpContext | HttpContext.Request.PathBase — available from server-side code. |
ShellScope | ShellScope.Context.Settings.RequestUrlPrefix — Orchard Core shell-level setting. |
ISiteService | (await SiteService.GetSiteSettingsAsync()).BaseUrl — configurable in the admin UI. |
@inject NavigationManager NavManager
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href=@_baseUrl />
<link rel="stylesheet" href="OrchardCore.Resources/Styles/bootstrap.min.css" />
<link rel="stylesheet" href="_content/BlazorLib/BlazorLib.bundle.scp.css" />
<HeadOutlet />
</head>
<body>
<Routes />
<script src="_framework/blazor.web.js"></script>
</body>
</html>
@code
{
protected string _baseUrl = "/";
protected override void OnParametersSet()
{
base.OnParametersSet();
_baseUrl = NavManager.BaseUri;
}
}
Import content definitions and content items for your Blazor app through the admin UI at Tools > Deployments > JSON Import:
{
"steps": [
{
"name": "ContentDefinition",
"ContentTypes": [
{
"Name": "MarkdownPage",
"DisplayName": "Markdown Page",
"Settings": {
"ContentTypeSettings": {
"Creatable": true,
"Listable": true,
"Draftable": true,
"Versionable": true,
"Securable": true
}
},
"ContentTypePartDefinitionRecords": [
{
"PartName": "TitlePart",
"Name": "TitlePart",
"Settings": {
"ContentTypePartSettings": {
"Position": "0"
}
}
},
{
"PartName": "AliasPart",
"Name": "AliasPart",
"Settings": {
"ContentTypePartSettings": {
"Position": "1"
}
}
},
{
"PartName": "MarkdownBodyPart",
"Name": "MarkdownBodyPart",
"Settings": {
"ContentTypePartSettings": {
"Position": "2"
}
}
}
]
}
],
"ContentParts": []
},
{
"name": "Content",
"data": [
{
"ContentItemId": "[js:uuid()]",
"ContentType": "MarkdownPage",
"DisplayText": "Welcome to Blazor CMS",
"Latest": true,
"Published": true,
"AliasPart": {
"Alias": "welcome"
},
"MarkdownBodyPart": {
"Markdown": "## Welcome\nThis content is managed by Orchard Core and rendered by Blazor."
},
"TitlePart": {
"Title": "Welcome to Blazor CMS"
}
}
]
}
]
}
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
orchard-core, blazor-cms, razor-class-library, content-management, ssr
/orchardcore:orchardcore-blazorfrom 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