Manages CSS and JavaScript resources in Orchard Core: resource manifest registration, built-in named resources (jQuery, Bootstrap, Vue 3, Monaco, etc.), CDN settings, tag helpers, Liquid tags, and IResourceManager API. Useful for upgrading from Orchard Core 3 or troubleshooting missing resources.
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 registering and rendering CSS/JavaScript resources in Orchard Core.
<script asp-name>, <style asp-name>, <resources>, <link>, <meta>), the IResourceManager API, or IConfigureOptions<ResourceManagementOptions>, the consuming project must reference the OrchardCore.ResourceManagement NuGet package. OrchardCore modules and themes (which target OrchardCore.Module.Targets / OrchardCore.Theme.Targets) usually get it transitively, but standalone MVC, decoupled, or headless projects must add the <PackageReference Include="OrchardCore.ResourceManagement" /> explicitly. The @addTagHelper *, OrchardCore.ResourceManagement directive and the at="Foot"/at="Head" script placement resolve from that assembly.OrchardCore.Resources module provides the Resource Manager for declaring, ordering, and rendering scripts and styles.wwwroot folder via StaticFileMiddleware.~/ModuleName/ or ~/ThemeName/ prefix convention (tilde represents tenant base path).IConfigureOptions<ResourceManagementOptions> and calling services.AddResourceConfiguration<T>() in Startup.<script asp-name>, <style asp-name>) in Razor or {% script %} / {% style %} in Liquid.AppendVersion (enabled by default) appends an SHA256 hash for cache busting.UseCdn is disabled by default; enable it in Settings > General after setup.jQuery is still a registered resource: any theme or module script that needs it must require it explicitly.{ "steps": [...] }.sealed modifier except View Models.| Setting | Description |
|---|---|
AppendVersion | Appends a version hash to local scripts/styles for cache busting. On by default. |
UseCdn | Serves scripts/styles from configured CDN URLs instead of local files. Off by default. |
ResourceDebugMode | Serves non-minified versions and disables CDN/CdnBaseUrl. For development use. |
CdnBaseUrl | Prepends this base URL to local resources served via the Resource Manager. |
Common resources provided by OrchardCore.Resources (latest versions; older versions of several remain registered, so version="4" or depends-on="bootstrap:4" still resolve):
| Name | Type | Version | Dependencies |
|---|---|---|---|
jQuery / jQuery.slim | Script | 3.7.1 | - |
jQuery-ui | Script, Style | 1.14.2 | jQuery |
jQuery-ui-i18n | Script | 1.14.2 | jQuery-ui |
popperjs | Script | 2.11.8 | - |
bootstrap | Script | 5.3.8 (also 4.6.1) | popperjs |
bootstrap / bootstrap-rtl | Style | 5.3.8 | - |
bootstrap-select | Script, Style | 1.2.6 | bootstrap |
font-awesome | Style, Script | 7.3.1 (also 6.x, 5.x) | - |
font-awesome-v4-shims | Script | 7.3.1 | - |
codemirror (+ codemirror-mode-*, codemirror-addon-*) | Script, Style | 5.65.7 | - |
monaco | Script, Style | 0.52.2 | - (ES module build, no monaco-loader) |
trumbowyg | Script, Style | 2.31.0 | jquery-resizable |
nouislider | Script, Style | 15.7.0 | - |
vuejs | Script | 3.5.13 | - |
vue-multiselect | Script, Style | 3.2.0 (obsolete) | vuejs |
Sortable | Script | 1.15.3 | - |
vue-draggable | Script | 4.1.0 | vuejs, Sortable |
js-cookie | Script | 3.0.5 | - |
list-management | Script | 1.0.0 | - |
vue-multiselect is obsolete: it is still registered (with its styles in TheAdmin) but nothing in Orchard Core uses it since the pickers moved to bootstrap-select (OC #20303), and it will be removed in the next major version. New pickers render a <select> with bootstrap-select data-* attributes (data-live-search, data-show-selected-tags, data-open-options) and load server options with its source.data and source.search options; see the content picker view in orchardcore-content-fields.
<style asp-name="bootstrap-select" at="Head"></style>
<script asp-name="bootstrap-select" at="Foot"></script>
<select asp-for="SelectedTags" asp-items="Model.AvailableTags" multiple class="form-select"
data-live-search="true" data-show-selected-tags="true" data-width="100%"
data-live-search-placeholder="@T["Search"]" data-none-results-text="@T["No tags match {0}", "{0}"]"></select>
TheAdmin's own resources are the-admin (script and style), admin-main, admin-scheme-picker and admin-scheme-editor; TheOldAdmin registers the-old-admin (script and style) and the-old-admin-main (see orchardcore-admin-schemes).
list-management is a reusable admin helper for searchable lists, bulk selection, and filter auto-submit. Require it with <script asp-name="list-management" at="Foot"></script> and opt a container in with data-list-management.
Create a configuration class to define named resources:
namespace MyModule;
public sealed class ResourceManagementOptionsConfiguration : IConfigureOptions<ResourceManagementOptions>
{
private static readonly ResourceManifest _manifest;
static ResourceManagementOptionsConfiguration()
{
_manifest = new ResourceManifest();
_manifest
.DefineScript("MyModule-CustomScript")
.SetUrl("~/MyModule/js/custom.min.js", "~/MyModule/js/custom.js")
.SetCdn(
"https://cdn.example.com/custom.min.js",
"https://cdn.example.com/custom.js")
.SetCdnIntegrity(
"sha384-abc123minifiedhash",
"sha384-abc123debughash")
.SetVersion("1.0.0")
.SetDependencies("bootstrap:5");
_manifest
.DefineStyle("MyModule-CustomStyle")
.SetUrl("~/MyModule/css/custom.min.css", "~/MyModule/css/custom.css")
.SetVersion("1.0.0")
.SetDependencies("bootstrap");
}
public void Configure(ResourceManagementOptions options)
{
options.ResourceManifests.Add(_manifest);
}
}
Register in Startup.cs:
namespace MyModule;
public sealed class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddResourceConfiguration<ResourceManagementOptionsConfiguration>();
}
}
The resource settings can also be provided from configuration, globally or per tenant (OrchardCore:{TenantName}:Resources). The site General settings override these values.
{
"OrchardCore": {
"Resources": {
"ResourceDebugMode": "FromConfiguration",
"UseCdn": false,
"CdnBaseUrl": "https://cdn.example.com",
"AppendVersion": true
}
}
}
ResourceDebugMode accepts FromConfiguration (debug in every environment except Production), Enabled, or Disabled. The former OrchardCore_Resources section name still works but is deprecated.
Add to _ViewImports.cshtml:
@addTagHelper *, OrchardCore.ResourceManagement
<script asp-name="bootstrap"></script>
<style asp-name="bootstrap"></style>
<script asp-name="bootstrap" use-cdn="true"></script>
<script asp-name="bootstrap" version="4"></script>
<script asp-name="bootstrap" asp-append-version="true"></script>
<script asp-name="bootstrap" at="Foot"></script>
Define and register a resource directly in a view:
<script asp-name="foo" asp-src="~/MyTheme/js/foo.min.js" debug-src="~/MyTheme/js/foo.js" depends-on="bootstrap:5" version="1.0"></script>
<script asp-name="bar" asp-src="~/MyTheme/js/bar.min.js" debug-src="~/MyTheme/js/bar.js" depends-on="foo:1.0" version="1.0"></script>
{% script name:"bootstrap" %}
{% style name:"bootstrap" %}
{% script name:"bootstrap", use_cdn:"true" %}
{% script name:"bootstrap", version:"4" %}
{% script name:"bootstrap", append_version:"true" %}
{% script name:"bootstrap", at:"Foot" %}
{% script name:"foo", src:"~/MyTheme/js/foo.min.js", debug_src:"~/MyTheme/js/foo.js", depends_on:"bootstrap:5", version:"1.0" %}
<script at="Foot">
document.addEventListener('DOMContentLoaded', function() {
console.log('Page loaded');
});
</script>
Named inline script (rendered only once, with dependencies). A script that uses jQuery must declare it, because nothing else on the page is guaranteed to require it:
<script asp-name="MyInitScript" at="Foot" depends-on="jQuery">
$(function() { /* initialization */ });
</script>
{% scriptblock at: "Foot" %}
document.addEventListener('DOMContentLoaded', function() {
console.log('Page loaded');
});
{% endscriptblock %}
Named inline script:
{% scriptblock name: "MyInitScript", at: "Foot", depends_on:"jQuery" %}
$(function() { /* initialization */ });
{% endscriptblock %}
<style at="Head">
.hero-section { background: linear-gradient(to right, #667eea, #764ba2); }
</style>
Named inline style (rendered only once):
<style asp-name="hero-style" depends-on="bootstrap">
.hero-section { background: linear-gradient(to right, #667eea, #764ba2); }
</style>
{% styleblock at: "Head" %}
.hero-section { background: linear-gradient(to right, #667eea, #764ba2); }
{% endstyleblock %}
Named inline style:
{% styleblock name: "hero-style", depends_on:"bootstrap" %}
.hero-section { background: linear-gradient(to right, #667eea, #764ba2); }
{% endstyleblock %}
Use the link tag for non-stylesheet relationships (favicons, preloads):
<link asp-src="~/MyTheme/favicon/favicon-16x16.png" rel="icon" type="image/png" sizes="16x16" />
{% link rel:"icon", type:"image/png", sizes:"16x16", src:"~/MyTheme/favicon/favicon-16x16.png" %}
<meta asp-name="description" content="My website description" />
{% meta name:"description", content:"My website description" %}
Meta tag properties:
| Property | Description |
|---|---|
name (asp-name in Razor) | The name attribute |
content | The content attribute |
httpequiv | The http-equiv attribute |
charset | The charset attribute |
separator | Separator for multiple same-name tags |
Resources must be rendered in the layout to appear on the page.
<head>)Razor:
<head>
<resources type="Meta" />
<resources type="HeadLink" />
<resources type="HeadScript" />
<resources type="Stylesheet" />
</head>
Liquid:
<head>
{% resources type: "Meta" %}
{% resources type: "HeadLink" %}
{% resources type: "HeadScript" %}
{% resources type: "Stylesheet" %}
</head>
<resources type="Header" /> (Liquid {% resources type: "Header" %}) renders Meta, HeadLink, Stylesheet, and HeadScript in one call. Render shapes that register resources (menus, navbars) before the head resources, or pre-render them into a variable at the top of the layout.
<body>)Razor:
<body>
...
<resources type="FootScript" />
</body>
Liquid:
<body>
...
{% resources type: "FootScript" %}
</body>
Inject IResourceManager (package OrchardCore.ResourceManagement.Abstractions) to register resources from code that runs during the request, such as an MVC filter, a display driver, or a view component. Never register resources from an IShapeTableProvider: the shape table is built once and cached.
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.Filters;
using OrchardCore.Admin;
using OrchardCore.ResourceManagement;
namespace MyModule;
public sealed class AdminAssetsFilter : IAsyncResultFilter
{
private readonly IResourceManager _resourceManager;
public AdminAssetsFilter(IResourceManager resourceManager)
{
_resourceManager = resourceManager;
}
public async Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next)
{
if (context.IsViewOrPageResult() && AdminAttribute.IsApplied(context.HttpContext))
{
// Register named resources.
_resourceManager.RegisterResource("stylesheet", "bootstrap-select").AtHead();
_resourceManager.RegisterResource("script", "bootstrap-select").AtFoot();
// Register a custom inline script.
_resourceManager.RegisterFootScript(
new HtmlString("<script>console.log('Hello');</script>"));
// Register a meta tag.
_resourceManager.RegisterMeta(
new MetaEntry { Content = "Orchard Core", Name = "generator" });
}
await next();
}
}
Register the filter with services.Configure<MvcOptions>(options => options.Filters.Add<AdminAssetsFilter>());.
RequireSettings also supports UseVersion("5") (latest matching version, exception when missing), ShouldAppendVersion(true), UseCdn(true), UseCulture(...), and SetDependencies(...). Missing named resources are logged as errors.
| Location | Description |
|---|---|
Head | Rendered in <head> via HeadScript resources tag |
Foot | Rendered at end of <body> via FootScript resources tag |
Inline | Rendered at the point of declaration (default for unnamed scripts) |
bootstrap-select styles. Views that use bootstrap-select must add <style asp-name="bootstrap-select" at="Head"></style> (and the script).jQuery explicitly.vuejs 2.7.16, vue-multiselect 2.1.6, vue-multiselect-wrapper, and vue-draggable 2.24.3. Use vuejs 3 and vue-draggable 4, and drop :2 version pins from depends-on. Move multiselect pickers to bootstrap-select rather than vue-multiselect 3, which is obsolete.bootstrap-select: the admin-menu-permission-picker, menu-permission-picker and tags-editor styles, OrchardCore.ContentFields/Scripts/vue-multiselect-fields/vue-multiselect-fields.js (now picker-fields/picker-fields.js), and the vue-multiselect-created, vue-multiselect-userpicker-created, menu-permission-picker-created and admin-menu-permission-picker-created events.monaco-loader was removed; monaco is now an ES module build with a separate monaco stylesheet.OrchardCore_Resources configuration section to OrchardCore:Resources.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
orchard-core, resource-management, css-js, tag-helpers, liquid-templates
/orchardcore:orchardcore-resourcesfrom 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