Creates and uses shortcodes in Orchard Core, covering admin UI templates, recipe/deployment steps, permissions, code-based providers (delegate and class patterns), built-in shortcodes (image, asset_url, locale), and rendering in HTML/Markdown parts and fields.
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 working with shortcodes — small bracketed tokens that add dynamic behavior to content editors.
[brackets] that inject dynamic content into HTML or Markdown fields.OrchardCore.Shortcodes feature to use shortcodes; enable OrchardCore.Shortcodes.Templates for admin-managed templates.OrchardCore.Shortcodes.ShortcodesPermissions.ManageShortcodeTemplates (the old OrchardCore.Shortcodes.Permissions.ManageShortcodeTemplates member was removed in 4.0).ShortcodeDelegate (inline lambda) or IShortcodeProvider (class-based).[image], [asset_url], and [locale].HtmlBodyPart, HtmlField, MarkdownBodyPart, and MarkdownField. Shortcodes run on the rendered HTML (after Markdown conversion) and before final-output sanitization, so markup a shortcode returns is sanitized when the part or field has SanitizeHtml enabled.shortcode Liquid filter or Orchard.ShortcodesToHtmlAsync() Razor helper.sealed modifier.{ "steps": [...] } format.{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Shortcodes",
"OrchardCore.Shortcodes.Templates"
],
"disable": []
}
]
}
Shortcode templates are managed via Design → Shortcodes in the admin dashboard. The create and edit pages render Model.Editor built by ShortcodeTemplateDisplayDriver: a General card (ShortcodeTemplateGeneral_Edit) and a Template card (ShortcodeTemplateContent_Edit, ShortcodeTemplateCreateContent_Edit on create). Each template has the following fields:
| Property (label) | Description |
|---|---|
Name (Name) | The shortcode name, without brackets. |
Hint (Hint) | Tooltip text displayed in the shortcode picker. |
Usage (Usage) | HTML string describing usage and arguments. |
Categories (Categories) | Categories the shortcode belongs to, picked in a bootstrap-select list where new categories can be typed. |
DefaultValue (Default shortcode value) | The shortcode value inserted from the picker when selected. Defaults to the name. |
Content (Content) | The Liquid template that renders the shortcode output. |
bootstrap-select instead of vue-multiselect; the shortcodes-categories-editor JavaScript localizations and ShortcodesJSLocalizer were removed. Update overrides of the shortcode template views from the new ones (the posted values are unchanged)..shortcode-modal-btn) wraps every .shortcode-modal-input textarea and every CodeMirror editor passed to window.initializeCodeMirrorShortcodeWrapper(editor). Each button gets its own click handler and the modal reuses one Bootstrap Modal instance, so a page with ES module CodeMirror editors no longer opens the modal twice or leaves a backdrop behind.The following variables are available inside a shortcode Liquid template:
| Variable | Description |
|---|---|
Args | Named arguments provided by the user (e.g., [shortcode key="value"]). |
Content | Inner content between opening and closing tags. |
Context | Contextual data from the caller (e.g., the parent ContentItem). |
[display_text] Template| Field | Value |
|---|---|
Name | display_text |
Hint | Returns the display text of the content item. |
Usage | [display_text] |
Content | {{ Context.ContentItem.DisplayText }} |
The
ContentItemcontext is only available when the caller (e.g.,HtmlBodyPart) passes theContentItemto the shortcode context.
[site_name] Template| Field | Value |
|---|---|
Name | site_name |
Hint | Returns the site name. |
Usage | [site_name] |
Content | {{ Site.SiteName }} |
[primary] Template with Arguments| Field | Value |
|---|---|
Name | primary |
Hint | Formats text in the theme's primary color. |
Usage | [primary text] or [primary]text[/primary] |
Content | See Liquid below |
{% capture output %}
{% if Args.Text != nil %}
<span class="text-primary">{{ Args.Text }}</span>
{% else %}
<span class="text-primary">{{ Content }}</span>
{% endif %}
{% endcapture %}
{{ output | sanitize_html | raw }}
The ShortcodeTemplates step creates or updates templates by name. Usage is
sanitized on import; DefaultValue is the Default shortcode value.
{
"steps": [
{
"name": "ShortcodeTemplates",
"ShortcodeTemplates": {
"site_name": {
"Content": "{{ Site.SiteName }}",
"Hint": "Returns the site name.",
"Usage": "[site_name]",
"DefaultValue": "[site_name]",
"Categories": [ "Site" ]
}
}
}
]
}
The All Shortcode Templates deployment step (AllShortcodeTemplates)
exports every template in the same format.
Use ShortcodeDelegate for simple inline shortcodes registered in Startup.ConfigureServices:
public sealed class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddShortcode("bold", (args, content, ctx) =>
{
var text = args.NamedOrDefault("text");
if (!string.IsNullOrEmpty(text))
{
content = text;
}
return ValueTask.FromResult($"<b>{content}</b>");
}, describe =>
{
describe.DefaultValue = "[bold text-here]";
describe.Hint = "Add bold formatting with a shortcode.";
describe.Usage = "[bold 'your bold content here']";
describe.Categories = ["HTML Content"];
});
}
}
For complex shortcodes, implement IShortcodeProvider and register with AddShortcode<T>:
public sealed class AlertShortcodeProvider : IShortcodeProvider
{
public ValueTask<string> EvaluateAsync(string identifier, Arguments args, string content, Context context)
{
var alertType = args.NamedOrDefault("type") ?? "info";
return ValueTask.FromResult(
$"<div class=\"alert alert-{alertType}\" role=\"alert\">{content}</div>"
);
}
}
Register in Startup.ConfigureServices:
public sealed class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddShortcode<AlertShortcodeProvider>("alert", describe =>
{
describe.DefaultValue = "[alert] [/alert]";
describe.Hint = "Display a Bootstrap alert box.";
describe.Usage =
"[alert type=\"info\"]Your message here[/alert]<br>" +
"Supported types: info, warning, danger, success";
describe.Categories = ["HTML Content", "UI Components"];
});
}
}
[image]Renders an image from the media library.
[image alt="My lovely image"]my-image.jpg[/image]
| Parameter | Description |
|---|---|
alt | Alternative text for the image (accessibility and SEO). |
class | CSS class attribute for the <img> tag. |
append_version | Set to true to add a cache-busting query string. |
format | Output format: jpeg, png, gif, or bmp. |
quality | JPEG quality (0–100, default 75). |
width, height | Resize dimensions. Allowed: 16, 32, 50, 100, 160, 240, 480, 600, 1024, 2048. |
mode | Resize mode: pad, boxpad, max (default), min, stretch, crop. |
[asset_url]Returns a relative URL from the media library. Useful for backgrounds or links.
[asset_url]my-image.jpg[/asset_url]
Returns a path like /my-tenant/media/my-image.jpg. Supports the same format, quality, width, height, and mode parameters as [image].
[locale]Conditionally renders content based on the current culture. Requires OrchardCore.Localization.
[locale en]English Text[/locale][locale fr]French Text[/locale]
By default, parent cultures match (e.g., en-CA matches [locale en]). Pass false as the second argument for exact matching:
[locale en false]Exact English only[/locale]
Shortcodes are automatically rendered for HtmlBodyPart, HtmlField, MarkdownBodyPart, and MarkdownField shapes. Prefer rendering the shape, which also applies sanitization:
{{ Model.Content.HtmlBodyPart | shape_render }}
For manual rendering of a raw string, sanitize the result unless the source is trusted, because stored HTML is no longer sanitized on save:
{{ Model.ContentItem.Content.RawHtml.Content.Html | shortcode | sanitize_html | raw }}
ShortcodesToHtmlAsync(html, model) returns an HtmlString; pass the shape
Model to make its ContentItem available to the shortcodes:
@{
var html = (await Orchard.ShortcodesToHtmlAsync((string)Model.ContentItem.Content.RawHtml.Content.Html, Model)).ToString();
}
@Orchard.SanitizeHtml(html)
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
orchard-core, shortcodes, content-management, liquid-templates
/orchardcore:orchardcore-shortcodesfrom 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