Guides writing Orchard Core admin editor views using ocat CSS classes and card-based layout. Covers Edit.cshtml, Fields.Edit.cshtml, Settings.Edit.cshtml, IDisplayManager, placement, validation, hints, and UI text casing standards.
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.
Read when SKILL.md points to them.
Every admin view that edits something (a content part or field, a settings group, a workflow activity, a deployment step, or a module's own entity) lays out its rows with the static ocat- (Orchard Core Admin Theme) CSS classes, and every admin form groups those rows in cards declared by placement. TheAdmin styles them as a stacked Bootstrap form (or a horizontal one when the admin scheme enables Horizontal form layout); a custom admin theme can restyle every editor by overriding the classes and the Card shape, without touching any view.
ocat-* only in admin views. Never in front-end views (Login, Register, ForgotPassword, or anything rendered by the site theme).mb-3, form-group, form-label) for admin field rows, and do not use the @Orchard.GetWrapperClasses()-style helpers (removed in Orchard Core 3.0).card, fieldset/legend) in an editor view: the card comes from the shape's placement (see Cards).<admin-list> (see orchardcore-admin-lists).Write every string with the casing of the place where it is displayed (Orchard Core UI text standard):
| Use Title Case for | Use sentence case for |
|---|---|
| Admin menu items | Buttons and submit actions (Save, Add widget) |
| Breadcrumb items | Links and dropdown actions (Edit nodes) |
| Page titles and headings, including modal and dialog titles | Field, checkbox and radio labels (Display name) |
| Names acting as titles: workflow activities and events, deployment steps | Select options, tab names and card titles (Sender) |
| Table column headers (Content item ID) | |
| Tooltips, placeholders, hints, descriptions, messages, validation errors | |
| Permission descriptions (Manage admin settings) |
Two-Factor Authentication). Sentence case: only the first word, proper nouns, product names and acronyms.Edit Content Type - {0}.| Place | Don't | Do |
|---|---|---|
| Page heading | Change password | Change Password |
| Button | Add Widget | Add widget |
| Link | Edit Nodes | Edit nodes |
| Field label | Display All Content Types | Display all content types |
| Card title | Retry Policy | Retry policy |
| Select option | Checkbox List | Checkbox list |
| Column header | Content Item Id | Content item ID |
| Permission | Manage Media Profiles | Manage media profiles |
| Editor | Produced by | View file |
|---|---|---|
| Content part editor | ContentPartDisplayDriver<TPart>.Edit with GetEditorShapeType(context) | Views/{Part}.Edit.cshtml |
| Content field editor | ContentFieldDisplayDriver<TField>.Edit with GetEditorShapeType(context) | Views/{Field}.Edit.cshtml |
| Field editor variant | The field's Editor setting | Views/{Field}-{Editor}.Edit.cshtml plus Views/{Field}-{Editor}.Option.cshtml (the <option> shown in the editor dropdown) |
| Part settings (per content type) | ContentTypePartDefinitionDisplayDriver<TPart> returning "{Part}Settings_Edit" at Content in a card (.Card(S["Settings"], "20")) | Views/{Part}Settings.Edit.cshtml |
| Field settings | ContentPartFieldDefinitionDisplayDriver<TField> returning "{Field}Settings_Edit" at Content in a card | Views/{Field}Settings.Edit.cshtml |
| Site settings group | SiteDisplayDriver<TSettings> with .OnGroup(...) and a card per editor shape | Views/{Name}Settings.Edit.cshtml |
| Workflow activity, deployment step | ActivityDisplayDriver / DeploymentStepDisplayDriver ({Name}_Fields_Edit) | Views/Items/{Name}.Fields.Edit.cshtml |
| Module entity page | Your admin controller with IDisplayManager<TViewModel> and a DisplayDriver<TViewModel> | Views/{Controller}/Edit.cshtml rendering Model.Editor, Views/{TViewModel}.Edit.cshtml, one Views/{Shape}.Edit.cshtml per card |
Shape-based editors render only their rows: the hosting page already owns the <form>, the validation summary, the title, the cards and the Save button. Site settings get their Save button from the shared SiteSettings.SaveButton shape, so never add a form or a submit button to a settings editor.
ocat-* Classes| Class | Element | Purpose | Default TheAdmin style |
|---|---|---|---|
ocat-wrapper | <div> | Outer container of one field row. Carries asp-validation-class-for. | margin-bottom: 1rem |
ocat-label | <label> for one control, <span> for a group caption or a read-only value | Field label in the leading column. | Like .form-label |
ocat-label-required | <label> | Added next to ocat-label on every field whose editor rejects an empty value. | Appends a * in --bs-danger, with a 0.25rem inline-start padding (LTR and RTL) |
ocat-end | <div> | Holds the control, its validation message, and its hint, after a label. | None (stacked) |
ocat-end-offset | <div> | Same column with no label: checkboxes, switches, alerts, headings, buttons. | None (stacked) |
ocat-start | <div> | Leading column container for content other than a label (alignment/push). | None (stacked) |
ocat-limited-wrapper | <div> | Row (or inner wrapper) for a control that should stay narrow. | margin-bottom: 1rem |
ocat-limited | <div> | Constrains the control width inside ocat-limited-wrapper. | 100%, 50% from md, 33.333% from lg, 25% from xxl |
| Row | Pattern |
|---|---|
| Labelled full-width field | ocat-wrapper > ocat-label + ocat-end |
| Required field | Same, with class="ocat-label ocat-label-required". Use it whenever the editor rejects an empty value ([Required], a model error on empty, or an HTML required attribute); add it conditionally when the field is required only in some states, e.g. @(settings.Required ? "ocat-label-required" : null), and never on fields whose empty value is accepted or generated |
| Checkbox or switch (its label is inline) | ocat-wrapper > ocat-end-offset > form-check |
| Alert, notice, or buttons in the form flow | ocat-wrapper > ocat-end-offset (a section of fields is a card, not a heading) |
| Short control (number, port, page size, select, short code or path) | ocat-limited-wrapper > ocat-label + ocat-limited |
Short control in a part or field editor that needs content-part-wrapper-* / field-wrapper-* classes on the row | Keep the outer ocat-wrapper field-wrapper ..., nest ocat-limited-wrapper > ocat-limited inside ocat-end |
| Several controls (checkbox or radio list) or a script-rendered widget | ocat-wrapper > <span id="..._Label" class="ocat-label"> + ocat-end with role="group" (radiogroup for radios) and aria-labelledby |
| Read-only value | ocat-wrapper > <span class="ocat-label"> + ocat-end holding text |
<label> labels exactly one rendered, labelable control whose id matches its for. Never point asp-for of a label at a property rendered as a hidden input or by a script, and never use a <label> to caption several controls or a value: use the <span> caption patterns above.asp-for renders the same property twice, keep asp-for and give the copy a unique id, e.g. id="@Html.IdFor(m => m.Scope)_Hidden".input, select and textarea has a name or an id, including search boxes and controls generated by scripts.ocat-wrapper (or a top-level ocat-limited-wrapper). Never put an input, validation span, or hint directly in the wrapper.ocat-end (it has a label) or ocat-end-offset (it has none), never both.ocat-end / ocat-end-offset / ocat-limited (or inside the form-check of a checkbox).ocat-wrapper > ocat-end-offset row. Split a long form into cards (one editor shape per card) instead of adding headings or legends.d-none on the ocat-wrapper itself, not on an inner element.field-wrapper-* or content-part-wrapper-* classes with ocat-limited-wrapper; nest the limited wrapper instead.ocat-* inside; their outer content-part wrapper still does.<div class="ocat-wrapper" asp-validation-class-for="Title">
<label asp-for="Title" class="ocat-label ocat-label-required">@T["Title"]</label>
<div class="ocat-end">
<input asp-for="Title" class="form-control" autofocus />
<span asp-validation-for="Title"></span>
<span class="hint">@T["The title of the item."]</span>
</div>
</div>
<div class="ocat-wrapper" asp-validation-class-for="Expression">
<label asp-for="Expression" class="ocat-label">@T["Expression"]</label>
<div class="ocat-end">
<input asp-for="Expression" class="form-control code" />
<span asp-validation-for="Expression"></span>
<span class="hint">@T["A Liquid expression. Example {0}", "{{ Model.Value }}"]</span>
</div>
</div>
<div class="ocat-wrapper" asp-validation-class-for="Description">
<label asp-for="Description" class="ocat-label">@T["Description"]</label>
<div class="ocat-end">
<textarea asp-for="Description" class="form-control" rows="4"></textarea>
<span asp-validation-for="Description"></span>
</div>
</div>
<div class="ocat-wrapper" asp-validation-class-for="Category">
<label asp-for="Category" class="ocat-label">@T["Category"]</label>
<div class="ocat-end">
<select asp-for="Category" class="form-select" asp-items="Model.Categories"></select>
<span asp-validation-for="Category"></span>
</div>
</div>
form-control code renders a monospace input for scripts, patterns, and expressions.
<div class="ocat-wrapper" asp-validation-class-for="IsEnabled">
<div class="ocat-end-offset">
<div class="form-check">
<input asp-for="IsEnabled" type="checkbox" class="form-check-input" />
<label asp-for="IsEnabled" class="form-check-label">@T["Enable feature"]</label>
<span class="hint dashed">@T["Check to enable this feature."]</span>
</div>
</div>
</div>
<div class="ocat-wrapper">
<div class="ocat-end-offset">
<div class="alert alert-warning" role="alert">@T["Changing these values affects every tenant."]</div>
</div>
</div>
Use form-check form-switch for a toggle. A settings editor that has nothing to edit can render its explanation in an ocat-end-offset alert row and return;.
<div class="ocat-wrapper" asp-validation-class-for="Url">
<label asp-for="Url" class="ocat-label">@T["URL"]</label>
<div class="ocat-end">
<div class="input-group">
<span class="input-group-text">https://</span>
<input asp-for="Url" class="form-control" />
</div>
<span asp-validation-for="Url"></span>
</div>
</div>
When the validation message sits inside the input group (as in the user name and email editors), add has-validation to the group so Bootstrap keeps the rounded corners of the last control:
<div class="input-group has-validation">
<span class="input-group-text"><i class="fa-solid fa-user" aria-hidden="true"></i></span>
<input asp-for="UserName" class="form-control" />
<span asp-validation-for="UserName" class="text-danger"></span>
</div>
Give every control an accessible name: an icon-only button gets aria-label (and title), and a checkbox whose label is visually empty holds <span class="visually-hidden">@T["Select {0}", name]</span>.
<div class="ocat-limited-wrapper" asp-validation-class-for="PageSize">
<label asp-for="PageSize" class="ocat-label">@T["Page size"]</label>
<div class="ocat-limited">
<input asp-for="PageSize" type="number" min="1" class="form-control" />
<span asp-validation-for="PageSize"></span>
<span class="hint">@T["The default page size."]</span>
</div>
</div>
<div class="ocat-wrapper">
<span class="ocat-label">@T["Created"]</span>
<div class="ocat-end">
<span>@Model.CreatedUtc.ToString("g")</span>
</div>
</div>
<div class="ocat-wrapper">
<span id="@Html.IdFor(m => m.ContentTypes)_Label" class="ocat-label">@T["Content types"]</span>
<div class="ocat-end" role="group" aria-labelledby="@Html.IdFor(m => m.ContentTypes)_Label">
@for (var i = 0; i < Model.ContentTypes.Length; i++)
{
<div class="form-check">
<input type="checkbox" class="form-check-input" asp-for="ContentTypes[i].IsSelected" />
<label class="form-check-label" asp-for="ContentTypes[i].IsSelected">@Model.ContentTypes[i].DisplayName</label>
</div>
}
</div>
</div>
<div class="ocat-limited-wrapper">
<label asp-for="Mode" class="ocat-label">@T["Mode"]</label>
<div class="ocat-limited">
<select asp-for="Mode" class="form-select" asp-items="Html.GetEnumSelectList<ExportMode>()"></select>
</div>
</div>
<div id="@Html.IdFor(m => m.Schedule)_group" class="ocat-wrapper @(Model.Mode == ExportMode.Scheduled ? "" : "d-none")" asp-validation-class-for="Schedule">
<label asp-for="Schedule" class="ocat-label">@T["Schedule"]</label>
<div class="ocat-end">
<input asp-for="Schedule" class="form-control code" />
<span asp-validation-for="Schedule"></span>
</div>
</div>
<script at="Foot">
document.addEventListener('DOMContentLoaded', () => {
const mode = document.getElementById('@Html.IdFor(m => m.Mode)');
const group = document.getElementById('@(Html.IdFor(m => m.Schedule))_group');
const toggle = () => group.classList.toggle('d-none', mode.value !== '@nameof(ExportMode.Scheduled)');
mode.addEventListener('change', toggle);
toggle();
});
</script>
Admin scripts are plain DOM code: TheAdmin no longer loads jQuery. Larger scripts belong in a module script (<script asp-src="~/My.Module/Scripts/my-editor.min.js" at="Foot" type="module"></script>).
asp-validation-class-for="Prop" on the row adds has-validation-error is-invalid when ModelState has an error for that property (OrchardCore.DisplayManagement ValidationMessageTagHelper). Inputs with errors get input-validation-error, and TheAdmin draws the error border and icon.<span asp-validation-for="Prop"></span> renders the message; place it right after the control.OrchardCore.Mvc.ModelBinding:context.Updater.ModelState.AddModelError(Prefix, nameof(model.Pattern), S["A pattern is required when using the selected behavior."]);
context.Updater.ModelState.AddModelError(Prefix, S["..."]) reports a model-level error shown in the page's validation summary.<div asp-validation-summary="ModelOnly"></div> (or @Html.ValidationSummary() as the settings page does). Editors never render one.UpdateAsync (return Edit(model, context);) so the posted values and errors re-render.<span class="hint"> is secondary help text under the control; hint dashed prefixes it with an em dash and is used inside form-check rows.Hint setting) through the Hint_Admin shape so admin themes can restyle every field hint at once:@if (!string.IsNullOrEmpty(settings.Hint))
{
@await DisplayAsync(await New.Hint_Admin(Hint: settings.Hint))
}
Hint.Admin.cshtml renders <span class="hint dashed">@Model.Hint</span>. A custom admin theme can override Views/Hint.Admin.cshtml, for example with a Bootstrap tooltip button (TheAdmin initializes data-bs-toggle="tooltip" elements). A theme that does not depend on TheAdmin must provide this template.BooleanField), render the hint inside the form-check-label.Part and field editors put these classes on the outer row so themes can target one content type's editor:
ocat-wrapper content-part-wrapper content-part-wrapper-{part-name}, plus content-part-wrapper-{named-part-name} for a named part.ocat-wrapper field-wrapper field-wrapper-{part-name}-{field-name}, plus field-wrapper-{named-part-name}-{field-name} for a field of a named part.A field editor (Views/RatingField.Edit.cshtml) built like the shipped NumericField:
@model EditRatingFieldViewModel
@using OrchardCore.ContentManagement.Metadata.Models
@using OrchardCore.Mvc.Utilities
@{
var settings = Model.PartFieldDefinition.GetSettings<RatingFieldSettings>();
var partName = Model.PartFieldDefinition.PartDefinition.Name.HtmlClassify();
var fieldName = Model.PartFieldDefinition.Name.HtmlClassify();
var wrapperClasses = $"ocat-wrapper field-wrapper field-wrapper-{partName}-{fieldName}";
if (Model.PartFieldDefinition.IsNamedPart())
{
wrapperClasses += $" field-wrapper-{Model.PartFieldDefinition.ContentTypePartDefinition.Name.HtmlClassify()}-{fieldName}";
}
}
<div class="@wrapperClasses" id="@Html.IdFor(m => m.Value)_FieldWrapper" asp-validation-class-for="Value">
<label asp-for="Value" class="ocat-label @(settings.Required ? "ocat-label-required" : "")">@Model.PartFieldDefinition.DisplayName()</label>
<div class="ocat-end">
<div class="ocat-limited-wrapper">
<div class="ocat-limited">
<input asp-for="Value" type="number" min="0" max="@settings.Maximum" class="form-control content-preview-select" />
<span asp-validation-for="Value"></span>
</div>
</div>
@if (!string.IsNullOrEmpty(settings.Hint))
{
@await DisplayAsync(await New.Hint_Admin(Hint: settings.Hint))
}
</div>
</div>
Shipped field editors localize the display name with IDataLocalizer (D[Model.PartFieldDefinition.DisplayName(), DataLocalizationContext.ContentField(...)]) when Data Localization is used. content-preview-text / content-preview-select classes let the Content Preview feature refresh on input.
Every admin form (site settings, users, roles, content type, part and field settings, workflow activities, deployment steps, a module's own pages) groups its fields in cards, each a logical section with a short sentence case title such as Server, Authentication and Sender in the SMTP settings. Content item editors (parts and fields of a content item) are not grouped in cards.
.Location(l => l.Zone("Content", "1").Card(S["Server"], "10")). The card name is its title; the second argument orders the cards.Combine(...) (split shapes such as Settings_Edit__Site, Settings_Edit__TimeZone and Settings_Edit__Pagination for the general settings), each with its own template."place": "Content:5%Server;10". Card names written in placement files aren't localized..Location(l => l.Zone("Content", "1").Tab(S["Providers"], "10").Card(S["Default provider"], "10")).Content group).using Microsoft.Extensions.Localization;
using OrchardCore.DisplayManagement.Entities;
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.DisplayManagement.Views;
using OrchardCore.Settings;
public sealed class SmsGatewaySettingsDisplayDriver : SiteDisplayDriver<SmsGatewaySettings>
{
public const string GroupId = "sms-gateway";
internal readonly IStringLocalizer S;
public SmsGatewaySettingsDisplayDriver(IStringLocalizer<SmsGatewaySettingsDisplayDriver> stringLocalizer)
{
S = stringLocalizer;
}
protected override string SettingsGroupId => GroupId;
public override IDisplayResult Edit(ISite site, SmsGatewaySettings settings, BuildEditorContext context)
{
return Combine(
Initialize<SmsGatewaySettingsViewModel>("SmsGatewaySettings_Edit", model => model.Endpoint = settings.Endpoint)
.Location(l => l.Zone("Content", "1").Card(S["Server"], "10"))
.OnGroup(SettingsGroupId),
Initialize<SmsGatewaySettingsViewModel>("SmsGatewaySettings_Edit__Sender", model => model.SenderNumber = settings.SenderNumber)
.Location(l => l.Zone("Content", "2").Card(S["Sender"], "20"))
.OnGroup(SettingsGroupId));
}
public override async Task<IDisplayResult> UpdateAsync(ISite site, SmsGatewaySettings settings, UpdateEditorContext context)
{
var model = new SmsGatewaySettingsViewModel();
await context.Updater.TryUpdateModelAsync(model, Prefix);
settings.Endpoint = model.Endpoint;
settings.SenderNumber = model.SenderNumber;
return Edit(site, settings, context);
}
}
Views/SmsGatewaySettings.Edit.cshtml and Views/SmsGatewaySettings-Sender.Edit.cshtml (the __Sender alternate) each hold only rows. Both shapes share the view model and prefix, so their fields post into one model.
CardContainer shape renders the cards of a zone (div.ocat-cards); the Card shape renders each card as a <fieldset> with a <legend>, styled as a Bootstrap card (card, card-header legend, card-body), always expanded. Hooks: ocat-card, ocat-card-{name}, ocat-card-title, ocat-card-body.Card.cshtml and CardContainer.cshtml in a custom admin theme (model GroupingViewModel / GroupViewModel).| Modifier | Grouping | Example |
|---|---|---|
#Name;order | Tab | Parts:1#Settings;2 |
%Name;order | Card | Content:1%Server;10 |
|Name_width;order | Column (Bootstrap col-md-{width}, or _lg-9 for another breakpoint) | Parts:1|Main_9;1 |
Content tab once others are grouped; give shapes distinct positions within a zone.placement.json can regroup editors of other modules ("place": "Parts:0#Media;0"). See orchardcore-placement for the full syntax.|Column editor groupings for admin list grid cells; lists declare columns with <admin-list-column>.A module's own edit page owns the title, form, summary, and actions, and renders an editor built by the display drivers of its view model, so its fields are grouped in cards and other modules can add fields and cards with drivers of the same view model:
@model RecordEditViewModel
<zone Name="Title">
<breadcrumb name="RecordsEdit" title="@T["Edit Record - {0}", Model.Name]">
<breadcrumb-item id="Records" action="Index" controller="Record" area="My.Module">@T["Records"]</breadcrumb-item>
</breadcrumb>
</zone>
<div asp-validation-summary="ModelOnly"></div>
<form asp-action="Edit" asp-route-returnUrl="@ViewData["ReturnUrl"]" method="post" class="no-multisubmit">
<input type="hidden" asp-for="Id" />
@await DisplayAsync(Model.Editor)
<div class="action-bar-bottom">
<a asp-action="Index" class="btn btn-secondary cancel" role="button">@T["Cancel"]</a>
<a asp-action="Delete" asp-route-id="@Model.Id" class="btn btn-danger action-bar-secondary" role="button" data-url-af="UnsafeUrl RemoveUrl">@T["Delete"]</a>
<button type="submit" class="btn btn-primary save">@T["Save"]</button>
</div>
</form>
The view model holds [BindNever] public IShape Editor { get; set; }. The controller builds it, and updates it on post before checking ModelState:
// GET
model.Editor = await _recordDisplayManager.BuildEditorAsync(model, _updateModelAccessor.ModelUpdater, isNew: false);
// POST
model.Editor = await _recordDisplayManager.UpdateEditorAsync(model, _updateModelAccessor.ModelUpdater, isNew: false);
if (!ModelState.IsValid)
{
return View(model);
}
_recordDisplayManager is an injected IDisplayManager<RecordEditViewModel> and _updateModelAccessor an IUpdateModelAccessor. Views/RecordEditViewModel.Edit.cshtml renders the zone of cards:
@await DisplayAsync(Model.Content)
A DisplayDriver<RecordEditViewModel> (registered with services.AddDisplayDriver<RecordEditViewModel, RecordEditDisplayDriver>()) returns one shape per card, binds its fields in UpdateAsync, and overrides BuildPrefix to Prefix = htmlFieldPrefix ?? string.Empty; when the page posts unprefixed field names. See orchardcore-admin references/admin-examples.md for a complete controller, driver and views.
no-multisubmit makes TheAdmin ignore a second submit while the form posts.action-bar-bottom contract.Model.Editor (templates, OpenID applications, roles, tenants, ...) must render Model.Editor too, with their fields moved to the templates of the editor shapes.ta-content-fluid class to keep the whole width when the admin scheme sets a content width (see orchardcore-admin-schemes).orchardcore-breadcrumbs for the title trail and orchardcore-admin for controllers and routes.Since Orchard Core 4.0 the submit buttons of admin edit pages (Publish, Save, Cancel, ...) render in a bar fixed to the bottom of the viewport, always visible without scrolling. TheAdmin pads the page so the bar never hides the end of the form.
<div class="action-bar-bottom">, typically the last child of the <form>. Do not wrap them in ocat-wrapper/ocat-end-offset or the old top position-sticky action-bar card.btn-secondary link with the cancel class; then the secondary actions; and the main action (Save, Create, Publish, or its btn-group with a Save and continue dropdown) last. Keep this order in the markup, not with CSS, so keyboard focus follows the visual order.btn-secondary for Cancel and alternative actions (Save & configure, Create & setup), btn-danger for destructive actions, btn-primary for the main action. Only the content item Publish button uses btn-success, to stand apart from Save draft.action-bar-secondary. A secondary action can be one button or a whole control group (for example a btn-group or an input plus a button).AdminSettings.ActionsLayout) resolves to Menu, secondary actions move into one ellipsis menu at the end of the bar, listing destructive actions (btn-danger, btn-outline-danger) last below a divider; on small screens they always do.SiteSettings.SaveButton shape (optional Cancel to returnUrl, then Save). Content action shapes placed in the content editor's Actions zone render inside Content.Edit's action-bar-bottom, after its Cancel link, so give secondary buttons action-bar-secondary and a position that follows the order below..modal-footer, and the dialog opened by TheAdmin's confirmDialog()) use the same order: Cancel or Close first, any secondary action (for example Reset anchor) next, the confirming action (OK, Save, Delete) last.<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">@T["Cancel"]</button>
<button type="button" class="btn btn-primary" data-my-module-save>@T["OK"]</button>
</div>
Positions of the built-in content editor action shapes (Actions zone of Content.Edit):
| Shape | Button | Position |
|---|---|---|
ContentPreview_Button | Preview | Actions:5 |
Content_DeleteButton | Delete | Actions:10 |
Content_UnpublishButton | Unpublish | Actions:20 |
ArchiveLaterPart_Edit | Archive later | Actions:20.5 |
PublishLaterPart_Edit | Publish later | Actions:25 |
Content_UserTaskButton | workflow user task actions | Actions:28 |
Content_SaveDraftButton | Save draft | Actions:30 |
Content_PublishButton | Publish | Actions:40 |
Before Orchard Core 4.0 final, Publish was at Actions:10, Delete at Actions:40, Preview at Actions:after, Archive later at Actions:10.5, Publish later at Actions:10 and the user task buttons at Actions:30; placement rules that position a custom shape relative to these buttons need new positions (for example Actions:35 to sit between Save draft and Publish).
A split button can remember the last action the user chose (for example Save vs Save and continue). Put these attributes on the btn-group, which contains one submit button and one dropdown-item submit button, both with an explicit value:
<div class="btn-group"
role="group"
aria-label="@T["Save actions"]"
data-action-group="my-module-record-save-action"
data-action-default="Save"
data-label-default="@T["Save"]"
data-action-alt="SaveAndContinue"
data-label-alt="@T["Save and continue"]">
<button type="submit" name="submit" value="Save" class="btn btn-primary save">@T["Save"]</button>
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
<span class="visually-hidden">@T["Toggle dropdown"]</span>
</button>
<div class="dropdown-menu">
<button type="submit" name="submit" value="SaveAndContinue" class="dropdown-item save-continue">@T["and continue"]</button>
</div>
</div>
data-action-group is the storage key (pages sharing a key share the choice); the choice is stored per tenant in the browser's admin preferences.
The classes are the theming contract. TheAdmin has a horizontal layout built in: check Horizontal form layout on the admin scheme (Design → Themes, Schemes) or set "HorizontalFormLayout": true on the scheme in the AdminSchemes recipe step (see orchardcore-admin-schemes). Test every new or changed view in the stacked layout and again with that option on: every label must sit beside its editor, checkboxes and alerts must line up under the editors, and nothing may overflow. A row that stays stacked isn't built with the ocat-* classes: fix the view, never the stylesheet.
A custom admin theme that doesn't build on TheAdmin (see orchardcore-theme-creator) can turn every editor into a horizontal form with CSS only:
.ocat-wrapper,
.ocat-limited-wrapper {
--ocat-gutter-x: 1.5rem;
display: flex;
flex-wrap: wrap;
margin-right: calc(-0.5 * var(--ocat-gutter-x));
margin-left: calc(-0.5 * var(--ocat-gutter-x));
margin-bottom: 1rem;
}
.ocat-wrapper > *,
.ocat-limited-wrapper > * {
box-sizing: border-box;
flex-shrink: 0;
width: 100%;
max-width: 100%;
padding-right: calc(var(--ocat-gutter-x) * 0.5);
padding-left: calc(var(--ocat-gutter-x) * 0.5);
}
.ocat-label { flex: 0 0 auto; width: 25%; padding-top: calc(0.375rem + var(--bs-border-width)); text-align: end; }
.ocat-start { flex: 0 0 auto; width: 25%; }
.ocat-end { flex: 0 0 auto; width: 75%; }
.ocat-end-offset { flex: 0 0 auto; width: 75%; margin-inline-start: 25%; }
.ocat-limited { flex: 0 0 auto; width: 33.333%; max-width: 33.333%; }
This works only because views follow the rules above: a row that skips ocat-end or mixes it with ocat-end-offset breaks the alignment.
| Old markup | New markup |
|---|---|
<div class="mb-3">, <div class="form-group">, @Orchard.GetWrapperClasses() | <div class="ocat-wrapper"> |
<label class="form-label">, @Orchard.GetLabelClasses() | <label class="ocat-label"> |
@Orchard.GetLabelClasses(inputRequired: true), label.input-required | ocat-label ocat-label-required |
Control directly in the row, @Orchard.GetEndClasses() | Wrap in <div class="ocat-end"> |
@Orchard.GetEndClasses(true), @Orchard.GetOffsetClasses(), checkbox rows | <div class="ocat-end-offset"> |
@Orchard.GetStartClasses() | ocat-start |
@Orchard.GetLimitedWidthWrapperClasses(), @Orchard.GetLimitedWidthClasses() | ocat-limited-wrapper, ocat-limited |
@Orchard.GetPartWrapperClasses(...), @Orchard.GetFieldWrapperClasses(...) | Literal ocat-wrapper content-part-wrapper ... / ocat-wrapper field-wrapper ... |
TheAdminThemeOptions, TheAdminTheme:StyleSettings | CSS overrides of the ocat-* classes in an admin theme |
| Hint directly in the row | Hint inside ocat-end / ocat-end-offset |
Buttons in ocat-wrapper > ocat-end-offset, or a top card ... position-sticky action-bar | <div class="action-bar-bottom">, secondary actions with action-bar-secondary |
<div class="card">, <fieldset>/<legend> or <h5> section headings in an editor view | One editor shape per section, placed with .Card(S["..."], "position") |
Fields written directly in a page view (Create.cshtml, Edit.cshtml) | @await DisplayAsync(Model.Editor) built with IDisplayManager<TViewModel>, fields in the templates of the driver's shapes |
<label class="ocat-label"> captioning several controls or a value | <span id="..._Label" class="ocat-label"> + role="group" and aria-labelledby (or a plain <span class="ocat-label"> for a value) |
See references/admin-edit-views-examples.md for a complete part with its driver, part settings editor, site settings editor, and workflow activity editor.
orchardcore-admin for TheAdmin, admin controllers, routes, and settings pages.orchardcore-admin-lists for admin index (list) pages.orchardcore-breadcrumbs for the page title trail.orchardcore-display-management and orchardcore-placement for display drivers and editor placement.orchardcore-content-parts, orchardcore-content-fields, and orchardcore-site-settings for the models behind the editors.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
orchard-core, admin-views, ocat-css, edit-views, content-parts, placement
/orchardcore:orchardcore-admin-edit-viewsfrom 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