Creates admin-defined custom site settings in Orchard Core using the CustomSettings stereotype. Covers content type definition, permissions, code/Liquid access, recipe steps, and deployment.
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 creating site-wide settings sections using the CustomSettings stereotype.
OrchardCore.CustomSettings feature to use custom site settings.CustomSettings stereotype, made of parts and fields like any other content type.Creatable, Listable, Draftable, and Versionable options; also leave Securable off, since each section gets its own permission.CustomSettings stereotype; this breaks existing content items of that type.ManageCustomSettings_{TypeName} permission under the OrchardCore.CustomSettings group of the Roles editor; it has no default role stereotype.ContentItem named after the type in the site document Properties.ISiteService.GetCustomSettingsAsync("TypeName") (from OrchardCore.Contents.Core).{{ Site.Properties }} is redacted in Liquid. List each section in OrchardCore:Liquid:PermittedSiteProperties before reading it from Liquid.HtmlBodyPart, HtmlField, MarkdownBodyPart, and MarkdownField no longer execute Liquid; use LiquidPart or LiquidField for templated content.SiteDisplayDriver<TSettings>; see orchardcore-site-settings.sealed modifier, except view models.{ "steps": [...] } format.{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.CustomSettings"
],
"disable": []
}
]
}
public sealed class {{SettingsPartName}} : ContentPart
{
public string {{PropertyName}} { get; set; }
public bool {{BoolPropertyName}} { get; set; }
}
public sealed class Migrations : DataMigration
{
private readonly IContentDefinitionManager _contentDefinitionManager;
public Migrations(IContentDefinitionManager contentDefinitionManager)
{
_contentDefinitionManager = contentDefinitionManager;
}
public async Task<int> CreateAsync()
{
await _contentDefinitionManager.AlterTypeDefinitionAsync("{{SettingsTypeName}}", type => type
.DisplayedAs("{{Settings Display Name}}")
.Stereotype("CustomSettings")
.WithPart("{{SettingsPartName}}", part => part
.WithPosition("0")
)
);
return 1;
}
}
[RequireFeatures("OrchardCore.CustomSettings")]
public sealed class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddContentPart<{{SettingsPartName}}>()
.UseDisplayDriver<{{SettingsPartName}}DisplayDriver>();
services.AddDataMigration<Migrations>();
}
}
Registering a typed part only supplies its CLR model. Add a display driver when its CLR properties need an editor:
public sealed class {{SettingsPartName}}DisplayDriver : ContentPartDisplayDriver<{{SettingsPartName}}>
{
public override IDisplayResult Edit({{SettingsPartName}} part, BuildPartEditorContext context)
=> Initialize<{{SettingsPartName}}ViewModel, {{SettingsPartName}}>("{{SettingsPartName}}_Edit", static (model, part) =>
{
model.{{PropertyName}} = part.{{PropertyName}};
model.{{BoolPropertyName}} = part.{{BoolPropertyName}};
}, part);
public override async Task<IDisplayResult> UpdateAsync({{SettingsPartName}} part, UpdatePartEditorContext context)
{
var model = new {{SettingsPartName}}ViewModel();
await context.Updater.TryUpdateModelAsync(model, Prefix);
part.{{PropertyName}} = model.{{PropertyName}};
part.{{BoolPropertyName}} = model.{{BoolPropertyName}};
return Edit(part, context);
}
}
public class {{SettingsPartName}}ViewModel
{
public string {{PropertyName}} { get; set; }
public bool {{BoolPropertyName}} { get; set; }
}
Content fields attached to the part (Media, Html, Link, ...) are rendered by their own drivers; no extra driver code is needed for them.
public sealed class MyService
{
private readonly ISiteService _siteService;
public MyService(ISiteService siteService)
{
_siteService = siteService;
}
public async Task<{{SettingsPartName}}> GetSettingsAsync()
{
ContentItem settingsItem = await _siteService.GetCustomSettingsAsync("{{SettingsTypeName}}");
return settingsItem.GetOrCreate<{{SettingsPartName}}>();
}
}
Without the extension method:
var siteSettings = await _siteService.GetSiteSettingsAsync();
var settingsItem = siteSettings.GetOrCreate<ContentItem>("{{SettingsTypeName}}");
GetCustomSettingsAsync() returns the cached instance; do not modify it. To change a section in code, use LoadSiteSettingsAsync(), update site.Properties["{{SettingsTypeName}}"], and call UpdateSiteSettingsAsync().
Custom settings types can be edited in the admin by anyone with the EditContentTypes permission, so treat their schema as part of your deployment and avoid relying on parts that administrators can remove.
public sealed class MyController : Controller
{
private readonly ISiteService _siteService;
public MyController(ISiteService siteService)
{
_siteService = siteService;
}
public async Task<IActionResult> Index()
{
var settingsItem = await _siteService.GetCustomSettingsAsync("{{SettingsTypeName}}");
var settings = settingsItem.GetOrCreate<{{SettingsPartName}}>();
return View(settings);
}
}
First allow the section names (application or tenant configuration):
{
"OrchardCore": {
"Liquid": {
"PermittedSiteProperties": [
"{{SettingsTypeName}}",
"BlogSettings"
]
}
}
}
Then read them by type name and part name:
{{ Site.Properties.{{SettingsTypeName}}.{{SettingsPartName}}.{{PropertyName}} }}
HTML stored in a custom settings section is persisted exactly as authored and is only sanitized when rendered through its display shape. When outputting raw HTML from Liquid, sanitize it explicitly:
{{ Site.Properties.BlogSettings.HtmlBodyPart.Html | sanitize_html | raw }}
Liquid syntax inside that HTML is not executed. Add a LiquidPart (or a LiquidField) to the section when editors need templated content.
OrchardCore.CustomSettings group, check Manage custom settings - {Display Name}.The permission name is ManageCustomSettings_{TypeName}; grant it to the roles that must see and save the section.
public sealed class Migrations : DataMigration
{
private readonly IContentDefinitionManager _contentDefinitionManager;
public Migrations(IContentDefinitionManager contentDefinitionManager)
{
_contentDefinitionManager = contentDefinitionManager;
}
public async Task<int> CreateAsync()
{
await _contentDefinitionManager.AlterTypeDefinitionAsync("BrandingSettings", type => type
.DisplayedAs("Branding Settings")
.Stereotype("CustomSettings")
.WithPart("BrandingSettings", part => part
.WithPosition("0")
)
);
await _contentDefinitionManager.AlterPartDefinitionAsync("BrandingSettings", part => part
.WithField("Logo", field => field
.OfType("MediaField")
.WithDisplayName("Site Logo")
.WithPosition("0")
)
.WithField("FooterText", field => field
.OfType("HtmlField")
.WithDisplayName("Footer Text")
.WithPosition("1")
.WithEditor("Wysiwyg")
)
.WithField("SocialLink", field => field
.OfType("LinkField")
.WithDisplayName("Social Media Link")
.WithPosition("2")
)
);
return 1;
}
}
{% assign branding = Site.Properties.BrandingSettings.BrandingSettings %}
{{ branding.FooterText.Html | sanitize_html | raw }}
<a href="{{ branding.SocialLink.Url }}">{{ branding.SocialLink.Text }}</a>
(Requires "BrandingSettings" in PermittedSiteProperties.)
The custom-settings step copies each named entry into the site Properties:
{
"steps": [
{
"name": "custom-settings",
"{{SettingsTypeName}}": {
"ContentItemId": "[js:uuid()]",
"ContentType": "{{SettingsTypeName}}",
"{{SettingsPartName}}": {
"{{PropertyName}}": "{{value}}",
"{{BoolPropertyName}}": true
}
}
}
]
}
{
"steps": [
{
"name": "ContentDefinition",
"ContentTypes": [
{
"Name": "{{SettingsTypeName}}",
"DisplayName": "{{Settings Display Name}}",
"Settings": {
"ContentTypeSettings": {
"Stereotype": "CustomSettings"
}
},
"ContentTypePartDefinitionRecords": [
{
"PartName": "{{SettingsPartName}}",
"Name": "{{SettingsPartName}}",
"Settings": {
"ContentTypePartSettings": {
"Position": "0"
}
}
}
]
}
]
}
]
}
The Custom Settings deployment step (in the Settings category, requires OrchardCore.Deployment) exports all sections, or the selected SettingsTypeNames, as a custom-settings recipe step. Only sections the exporting user may manage are exported.
{{ Site.Properties.MySettings... }} render nothing until MySettings is added to OrchardCore:Liquid:PermittedSiteProperties.HtmlBodyPart/HtmlField of a section is no longer executed (the RenderLiquid setting is gone); move it to a LiquidPart or LiquidField.Site.Properties is the authored source; pipe it through sanitize_html before raw.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
orchard-core, custom-settings, site-settings, content-type, liquid
/orchardcore:orchardcore-custom-settingsfrom 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