Provides guidance on using HtmlBodyPart in Orchard Core: attaching to content types, rendering with Liquid/Razor shapes, sanitization, shortcodes, and editor configuration.
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.
Enable OrchardCore.Html and attach HtmlBodyPart to a content type. The
part stores the authored source in HtmlBodyPart.Html; it has no Body
property.
await _contentDefinitionManager.AlterTypeDefinitionAsync("Article", type => type
.Creatable()
.WithPart("TitlePart", part => part.WithPosition("0"))
.WithPart("HtmlBodyPart", part => part
.WithPosition("1")
.WithEditor("Wysiwyg")
.WithSettings(new HtmlBodyPartSettings
{
SanitizeHtml = true,
})));
The source is persisted exactly as authored; it is never sanitized or
rewritten on save. On display (Detail, Summary, preview, BodyAspect, and the
GraphQL html field) the part:
Html.ContentItem in the shortcode context).HtmlBodyPartSettings.SanitizeHtml is true
(the default).Liquid syntax is not executed; it renders as literal text. Use LiquidPart or
a LiquidField when authored content needs Liquid (see orchardcore-liquid).
| Shape | Display Type | Default Location | Model |
|---|---|---|---|
HtmlBodyPart | Detail | Content:5 | HtmlBodyPartViewModel |
HtmlBodyPart | Summary | Content:10 | HtmlBodyPartViewModel |
HtmlBodyPartViewModel exposes Html (the final rendered HTML),
ContentItem, HtmlBodyPart (whose Html is the authored source), and
TypePartDefinition.
<article>
{{ Model.Html | raw }}
</article>
@model OrchardCore.Html.ViewModels.HtmlBodyPartViewModel
<article>@Html.Raw(Model.Html)</article>
Outside the part's own shape, render the shape instead of the stored source.
Model.ContentItem.Content.HtmlBodyPart.Html | raw outputs the unsanitized
source:
{{ Model.Content.HtmlBodyPart | shape_render }}
{{ Model.ContentItem.Content.HtmlBodyPart.Html | shortcode | sanitize_html | raw }}
Select the editor per content type in the part settings, or with
.WithEditor(...):
| Editor | Description |
|---|---|
Default | Plain text area. |
Wysiwyg | WYSIWYG editor. |
Trumbowyg | Trumbowyg editor; HtmlBodyPartTrumbowygEditorSettings (Options, InsertMediaWithUrl, AllowCustomScripts). |
Monaco | Source code editor; HtmlBodyPartMonacoEditorSettings (Options, InsertMediaWithUrl, AllowCustomScripts). |
Trumbowyg Options are a JavaScript object literal, validated with Acornima
(a direct dependency of OrchardCore.Html, no longer Jint) when the settings
are saved. Monaco Options must be valid JSON.
Declare an option shape HtmlBodyPart_Option__{Name}
(HtmlBodyPart-{Name}.Option.cshtml) and an editor shape
HtmlBodyPart_Edit__{Name} (HtmlBodyPart-{Name}.Edit.cshtml). The editor
binds the Html property:
@{
string currentEditor = Model.Editor;
}
<option value="Plain" selected="@(currentEditor == "Plain")">@T["Plain text area"]</option>
@using OrchardCore.Html.ViewModels
@model HtmlBodyPartViewModel
<div class="ocat-wrapper">
<label asp-for="Html" class="ocat-label">@T["Body"]</label>
<div class="ocat-end">
<textarea asp-for="Html" rows="10" class="form-control content-preview-text"></textarea>
</div>
</div>
Editors can be injected later by Flow, Bag, and widget list editors, so load
editor scripts as ES modules (<script asp-src="..." type="module" at="Foot">) and initialize every matching element, including elements added
after page load (for example with a MutationObserver), instead of relying on
DOMContentLoaded or fixed element ids. Admin scripts no longer load jQuery
implicitly.
IHtmlDisplayService (OrchardCore.Html.Services, registered by
services.AddHtmlServices()) applies the same shortcode and sanitization
pipeline to any HtmlViewModelBase model:
await _htmlDisplayService.UpdateModelHtmlAsync(
model,
new Shortcodes.Context { ["TypePartDefinition"] = typePartDefinition },
sanitizeHtml: true);
HtmlBodyPartSettings.RenderLiquid was removed. Liquid in existing HTML is
kept but no longer executed, and tenant startup logs a warning for each type
that had it enabled. Move that source to LiquidPart manually.Html may now
contain markup the sanitizer would remove, so templates that output
HtmlBodyPart.Html with raw must render the shape or pipe through
sanitize_html instead.SanitizeHtml = false remains the opt-out for trusted output.What SKILL.md sets; muted values are Claude Code's defaults
/orchardcore:orchardcore-htmlfrom 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