Provides guidance on using MarkdownBodyPart and MarkdownField in Orchard Core, including content editing, shape templates, Markdig pipeline configuration, and migration from RenderLiquid.
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, templates, and configuration for the Markdown module — enabling Markdown-based content editing with Markdig pipeline support.
OrchardCore.Markdown feature to use MarkdownBodyPart and MarkdownField.SanitizeHtml is enabled (the default).LiquidPart or LiquidField when content needs Liquid.MarkdownBodyPartViewModel / MarkdownFieldViewModel, whose Html is the final rendered output and whose Markdown is the authored source.OrchardCore:Markdown:Extensions setting or ConfigureMarkdownPipeline in code, and built once per tenant.Default (plain text area) and Wysiwyg.Markdown_Option__{Name} and Markdown_Edit__{Name} shape templates.sealed modifier, except View Models.{ "steps": [...] } format.{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Markdown"
],
"disable": []
}
]
}
public sealed class Migrations : DataMigration
{
private readonly IContentDefinitionManager _contentDefinitionManager;
public Migrations(IContentDefinitionManager contentDefinitionManager)
{
_contentDefinitionManager = contentDefinitionManager;
}
public async Task<int> CreateAsync()
{
await _contentDefinitionManager.AlterTypeDefinitionAsync("Article", type => type
.DisplayedAs("Article")
.Creatable()
.Listable()
.Draftable()
.Versionable()
.WithPart("TitlePart", part => part.WithPosition("0"))
.WithPart("MarkdownBodyPart", part => part
.WithPosition("1")
.WithEditor("Wysiwyg")
.WithSettings(new MarkdownBodyPartSettings
{
SanitizeHtml = true,
})
)
);
return 1;
}
}
MarkdownBodyPartSettings and MarkdownFieldSettings only expose
SanitizeHtml. The Wysiwyg editors accept Options through
MarkdownBodyPartWysiwygEditorSettings and MarkdownFieldWysiwygEditorSettings.
| Shape Name | Display Type | Default Location | Model Type |
|---|---|---|---|
MarkdownBodyPart | Detail | Content:5 | MarkdownBodyPartViewModel |
MarkdownBodyPart | Summary | Content:10 | MarkdownBodyPartViewModel |
| Property | Type | Description |
|---|---|---|
Markdown | string | The exact authored Markdown source. |
Html | string | The HTML after Markdown conversion, shortcodes, and sanitization. |
ContentItem | ContentItem | The content item of the part. |
MarkdownBodyPart | MarkdownBodyPart | The MarkdownBodyPart instance. |
TypePartSettings | MarkdownBodyPartSettings | The settings of the part. |
MarkdownBodyPart.Markdown is the authored source. Liquid syntax in it is
plain text.
The MarkdownFieldViewModel is used when a MarkdownField is attached to a content part:
| Property | Type | Description |
|---|---|---|
Markdown | string | The exact authored Markdown source. |
Html | string | The HTML after Markdown conversion, shortcodes, and sanitization. |
Field | MarkdownField | The MarkdownField instance. |
Part | ContentPart | The part this field is attached to. |
PartFieldDefinition | ContentPartFieldDefinition | The part field definition. |
The same pipeline applies to Detail, Summary, preview, BodyAspect, and the
GraphQL html field.
Override the detail display at Views/MarkdownBodyPart.liquid:
<article class="markdown-body">
{{ Model.Html | raw }}
</article>
Override the summary display at Views/MarkdownBodyPart.Summary.liquid:
<p>{{ Model.Html | strip_html | truncate: 200 }}</p>
Convert an arbitrary Markdown string in Liquid with markdownify, which
always sanitizes its output:
{{ "### Services" | markdownify | raw }}
Override the detail display at Views/MarkdownBodyPart.cshtml:
@model OrchardCore.Markdown.ViewModels.MarkdownBodyPartViewModel
<article class="markdown-body">
@Html.Raw(Model.Html)
</article>
MarkdownToHtmlAsync(string markdown, bool sanitize = true) converts Markdown,
processes shortcodes, and sanitizes the final HTML unless sanitize is false:
@await Orchard.MarkdownToHtmlAsync((string)Model.ContentItem.Content.MarkdownParagraph.Content.Markdown)
@* Trusted output only *@
@await Orchard.MarkdownToHtmlAsync((string)Model.ContentItem.Content.MarkdownParagraph.Content.Markdown, sanitize: false)
| Service | Lifetime | Purpose |
|---|---|---|
IMarkdownService (DefaultMarkdownService) | Singleton | ToHtml(markdown) with the tenant Markdig pipeline only. |
IMarkdownDisplayService | Scoped | ToHtmlAsync(markdown, shortcodeContext, sanitizeHtml) — Markdown, then shortcodes, then sanitization. |
var html = await _markdownDisplayService.ToHtmlAsync(
markdown,
new Shortcodes.Context { ["ContentItem"] = contentItem },
sanitizeHtml: true);
DefaultMarkdownService builds its pipeline once, in its constructor, from
IOptions<MarkdownPipelineOptions>. A replacement IMarkdownService should
also be thread-safe and registered as a singleton.
Disable sanitization per content type by unchecking Sanitize HTML in the
MarkdownBody Part (or MarkdownField) settings, or allow extra attributes in the
HTML Sanitizer. For example, autoidentifiers needs the id attribute:
builder.Services
.AddOrchardCms()
.ConfigureServices(tenantServices =>
tenantServices.ConfigureHtmlSanitizer(sanitizer => sanitizer.AllowedAttributes.Add("id")));
| Editor Name | Description |
|---|---|
Default | Plain text area for raw Markdown editing. |
Wysiwyg | Rich editing experience with toolbar and preview. |
Select the editor in the MarkdownBody Part settings for each content type.
Create a file Markdown-{Name}.Option.cshtml to declare a new editor option:
@{
string currentEditor = Model.Editor;
}
<option value="MyCustomEditor" selected="@(currentEditor == "MyCustomEditor")">@T["My custom editor"]</option>
Create a file Markdown-{Name}.Edit.cshtml to render the editor:
@using OrchardCore.Markdown.ViewModels
@model MarkdownBodyPartViewModel
<fieldset class="ocat-wrapper">
<label asp-for="Markdown" class="ocat-label">@T["Markdown"]</label>
<div class="ocat-end">
<textarea asp-for="Markdown" rows="10" class="form-control"></textarea>
<span class="hint">@T["The markdown content of the item."]</span>
</div>
</fieldset>
Override the built-in editors with Markdown.Edit.cshtml (Default) or
Markdown-Wysiwyg.Edit.cshtml. Editor scripts should be ES modules that also
initialize editors injected later by Flow and Bag editors; admin pages no
longer load jQuery implicitly.
Configure Markdig extensions under OrchardCore:Markdown (the default is
nohtml+advanced; the old OrchardCore_Markdown section is deprecated but
still read). Per-tenant values go under OrchardCore:{TenantName}:Markdown.
{
"OrchardCore": {
"Markdown": {
"Extensions": "nohtml+advanced"
}
}
}
| Extension | Description |
|---|---|
advanced | Enable advanced Markdown extensions (bundle of common extensions). |
pipetables | Pipe-delimited tables. |
gfm-pipetables | GitHub Flavored Markdown pipe tables using header for column count. |
hardlinebreak | Treat soft line breaks as hard line breaks. |
footnotes | Footnote support. |
footers | Footer blocks. |
citations | Citation syntax. |
attributes | Attach HTML attributes to elements. |
gridtables | Grid-style tables. |
abbreviations | Abbreviation definitions. |
emojis | Emoji and smiley support. |
definitionlists | Definition list syntax. |
customcontainers | Custom block containers. |
figures | Figure elements. |
mathematics | Mathematical expressions. |
bootstrap | Bootstrap CSS class support. |
medialinks | Extended image links for video/audio. |
smartypants | Smart typography (curly quotes, dashes). |
autoidentifiers | Auto-generate heading IDs. |
tasklists | Task list checkboxes. |
diagrams | Diagram rendering. |
nofollowlinks | Add rel=nofollow to all links. |
noopenerlinks | Add rel=noopener to all links. |
noreferrerlinks | Add rel=noreferrer to all links. |
nohtml | Disable raw HTML in Markdown. |
yaml | Parse YAML front matter. |
nonascii-noescape | Do not %-escape non-ASCII characters in URIs. |
autolinks | Auto-link URLs (http://, https://, ftp://, mailto:, www.). |
globalization | Right-to-left content support. |
Configure the Markdig pipeline programmatically in Program.cs or Startup:
services
.AddOrchardCms()
.ConfigureServices(tenantServices =>
tenantServices.ConfigureMarkdownPipeline(pipeline =>
{
pipeline.UseEmojiAndSmiley();
}));
To clear all default pipeline configuration:
services
.AddOrchardCms()
.ConfigureServices(tenantServices =>
tenantServices.PostConfigure<MarkdownPipelineOptions>(o =>
{
o.Configure.Clear();
}));
Pipeline options are read once when the tenant shell is built; restart or release the tenant after changing them.
MarkdownBodyPartSettings.RenderLiquid and MarkdownFieldSettings.RenderLiquid
were removed. Liquid in existing Markdown stays stored but renders as text;
tenant startup logs a warning per affected part and field. Move that content
to LiquidPart or LiquidField.MarkdownToHtmlAsync(markdown, sanitize, renderLiquid) lost its
renderLiquid parameter.DefaultMarkdownService is a singleton whose constructor only takes
IOptions<MarkdownPipelineOptions>; update subclasses or custom registrations.OrchardCore_Markdown section to OrchardCore:Markdown.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/orchardcore:orchardcore-markdownfrom 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