Skill for adding and configuring built-in content parts in Orchard Core. Covers every built-in content part with all available settings, migration code patterns, and recipe configuration. Use this skill when requests mention Orchard Core Content Parts, Add and Configure Content Parts, General Pattern for Attaching a Part, TitlePart, TitlePart Settings, TitlePart Migration, or closely related Orchard Core implementation, setup, extension, or troubleshooting work. Strong matches include work with OrchardCore.Title, OrchardCore.Autoroute, OrchardCore.Html, OrchardCore.Markdown, OrchardCore.Lists, OrchardCore.Flows, OrchardCore.Alias, OrchardCore.PublishLater, OrchardCore.ContentLocalization, OrchardCore.Taxonomies, OrchardCore.Seo, OrchardCore.ContentPreview. It also helps with content parts examples, TitlePart Settings, TitlePart Migration, TitlePart with Generated Title, plus the code patterns, admin flows, recipe steps, and referenced examples captured in this skill.
You are an Orchard Core expert. Generate migration code and recipes for attaching and configuring built-in content parts.
AlterTypeDefinitionAsync in a migration..WithSettings(new XxxPartSettings { ... })..WithPosition("N") to control the order of parts in the editor.await _contentDefinitionManager.AlterTypeDefinitionAsync("{{ContentType}}", type => type
.WithPart("{{PartName}}", part => part
.WithPosition("{{Position}}")
.WithSettings(new {{PartName}}Settings
{
// Part-specific settings
})
)
);
Provides a title/display text for a content item. Feature: OrchardCore.Title.
| Setting | Type | Default | Description |
|---|---|---|---|
Options | TitlePartOptions | Editable | Title behavior: Editable, GeneratedDisabled, GeneratedHidden, EditableRequired. |
Pattern | string | "" | Liquid pattern to generate the title (used with GeneratedDisabled or GeneratedHidden). |
RenderTitle | bool | true | Whether to render the title in the content shape. |
await _contentDefinitionManager.AlterTypeDefinitionAsync("{{ContentType}}", type => type
.WithPart("TitlePart", part => part
.WithPosition("0")
.WithSettings(new TitlePartSettings
{
Options = TitlePartOptions.EditableRequired,
RenderTitle = true
})
)
);
await _contentDefinitionManager.AlterTypeDefinitionAsync("{{ContentType}}", type => type
.WithPart("TitlePart", part => part
.WithPosition("0")
.WithSettings(new TitlePartSettings
{
Options = TitlePartOptions.GeneratedDisabled,
Pattern = "{{ ContentItem.Content.{{ContentType}}.Name.Text }} - {{ ContentItem.Content.{{ContentType}}.Date.Value | date: '%Y-%m-%d' }}"
})
)
);
Generates a URL (slug) for a content item. Feature: OrchardCore.Autoroute.
| Setting | Type | Default | Description |
|---|---|---|---|
AllowCustomPath | bool | false | Whether users can define a custom path. |
Pattern | string | "{{ ContentItem.DisplayText | slugify }}" | Liquid pattern to generate the slug. |
ShowHomepageOption | bool | false | Whether to show the "Set as homepage" option. |
AllowUpdatePath | bool | false | Whether to allow re-generating the path on data change. |
AllowDisabled | bool | false | Whether to allow disabling autoroute on individual items. |
AllowRouteContainedItems | bool | false | Whether to route contained items. |
ManageContainedItemRoutes | bool | false | Whether this part manages contained item routes. |
AllowAbsolutePath | bool | false | Whether to allow absolute paths for contained items. |
await _contentDefinitionManager.AlterTypeDefinitionAsync("{{ContentType}}", type => type
.WithPart("AutoroutePart", part => part
.WithPosition("1")
.WithSettings(new AutoroutePartSettings
{
AllowCustomPath = true,
ShowHomepageOption = false,
Pattern = "{{ ContentItem.DisplayText | slugify }}",
AllowUpdatePath = true
})
)
);
Provides a rich HTML body editor. Feature: OrchardCore.Html.
| Setting | Type | Default | Description |
|---|---|---|---|
SanitizeHtml | bool | true | Whether to sanitize HTML content. |
| Editor | Description |
|---|---|
| (default) | Standard rich text editor. |
Wysiwyg | WYSIWYG HTML editor. |
Trumbowyg | Trumbowyg WYSIWYG editor. |
Monaco | Monaco code editor. |
await _contentDefinitionManager.AlterTypeDefinitionAsync("{{ContentType}}", type => type
.WithPart("HtmlBodyPart", part => part
.WithPosition("2")
.WithEditor("Wysiwyg")
.WithSettings(new HtmlBodyPartSettings
{
SanitizeHtml = true
})
)
);
Provides a Markdown body editor. Feature: OrchardCore.Markdown.
| Setting | Type | Default | Description |
|---|---|---|---|
SanitizeHtml | bool | true | Whether to sanitize HTML output. |
await _contentDefinitionManager.AlterTypeDefinitionAsync("{{ContentType}}", type => type
.WithPart("MarkdownBodyPart", part => part
.WithPosition("2")
.WithSettings(new MarkdownBodyPartSettings
{
SanitizeHtml = true
})
)
);
Makes a content type a container for other content items. Feature: OrchardCore.Lists.
| Setting | Type | Default | Description |
|---|---|---|---|
PageSize | int | 10 | Number of items to display per page. |
EnableOrdering | bool | false | Whether to allow manual ordering. |
ContainedContentTypes | string[] | [] | Content types that can be contained. |
ShowHeader | bool | true | Whether to show the list header. |
await _contentDefinitionManager.AlterTypeDefinitionAsync("Blog", type => type
.WithPart("ListPart", part => part
.WithPosition("3")
.WithSettings(new ListPartSettings
{
PageSize = 10,
EnableOrdering = false,
ContainedContentTypes = new[] { "BlogPost" },
ShowHeader = true
})
)
);
Enables a content type to contain a flow of widget content items. Feature: OrchardCore.Flows.
| Setting | Type | Default | Description |
|---|---|---|---|
ContainedContentTypes | string[] | [] | Content types that can be added to the flow. |
await _contentDefinitionManager.AlterTypeDefinitionAsync("{{ContentType}}", type => type
.WithPart("FlowPart", part => part
.WithPosition("3")
.WithSettings(new FlowPartSettings
{
ContainedContentTypes = new[] { "HtmlWidget", "ImageWidget", "BlockQuote" }
})
)
);
A container part allowing nested content items within a content item. Feature: OrchardCore.Flows.
| Setting | Type | Default | Description |
|---|---|---|---|
ContainedContentTypes | string[] | [] | Content types that can be added to the bag. |
DisplayType | string | "Detail" | Display type for rendering bag items. |
await _contentDefinitionManager.AlterTypeDefinitionAsync("{{ContentType}}", type => type
.WithPart("BagPart", "{{BagPartName}}", part => part
.WithDisplayName("{{DisplayName}}")
.WithPosition("4")
.WithSettings(new BagPartSettings
{
ContainedContentTypes = new[] { "Slide", "Testimonial" }
})
)
);
Provides an alias identifier for a content item. Feature: OrchardCore.Alias.
| Setting | Type | Default | Description |
|---|---|---|---|
Pattern | string | "" | Liquid pattern to generate the alias. |
await _contentDefinitionManager.AlterTypeDefinitionAsync("{{ContentType}}", type => type
.WithPart("AliasPart", part => part
.WithPosition("1")
.WithSettings(new AliasPartSettings
{
Pattern = "{{ ContentItem.DisplayText | slugify }}"
})
)
);
Allows scheduling future publish dates. Feature: OrchardCore.PublishLater.
await _contentDefinitionManager.AlterTypeDefinitionAsync("{{ContentType}}", type => type
.WithPart("PublishLaterPart", part => part
.WithPosition("5")
)
);
Enables content localization (translation). Feature: OrchardCore.ContentLocalization.
await _contentDefinitionManager.AlterTypeDefinitionAsync("{{ContentType}}", type => type
.WithPart("LocalizationPart", part => part
.WithPosition("6")
)
);
Makes a content type act as a taxonomy container. Feature: OrchardCore.Taxonomies.
| Setting | Type | Default | Description |
|---|---|---|---|
TermContentType | string | "" | The content type to use for terms. |
await _contentDefinitionManager.AlterTypeDefinitionAsync("{{TaxonomyType}}", type => type
.WithPart("TitlePart", part => part.WithPosition("0"))
.WithPart("TaxonomyPart", part => part
.WithPosition("1")
.WithSettings(new TaxonomyPartSettings
{
TermContentType = "{{TermContentType}}"
})
)
);
Provides SEO metadata (meta title, description, etc.). Feature: OrchardCore.Seo.
await _contentDefinitionManager.AlterTypeDefinitionAsync("{{ContentType}}", type => type
.WithPart("SeoMetaPart", part => part
.WithPosition("10")
)
);
Enables content preview. Feature: OrchardCore.ContentPreview.
| Setting | Type | Default | Description |
|---|---|---|---|
Pattern | string | "" | Liquid pattern for the preview URL. |
await _contentDefinitionManager.AlterTypeDefinitionAsync("{{ContentType}}", type => type
.WithPart("PreviewPart", part => part
.WithPosition("11")
.WithSettings(new PreviewPartSettings
{
Pattern = "{{ ContentItem | display_url }}"
})
)
);
When defining a content type, these options control the content type behavior:
await _contentDefinitionManager.AlterTypeDefinitionAsync("{{ContentType}}", type => type
.DisplayedAs("{{DisplayName}}")
.Creatable() // Can be created from the admin
.Listable() // Appears in content listings
.Draftable() // Supports draft versions
.Versionable() // Supports versioning
.Securable() // Supports per-content permissions
.Stereotype("{{Stereotype}}") // Set a stereotype (e.g., "Widget", "MenuItem")
);
Modules that provide custom parts from external sources (CrestApps, Lombiq, or community modules) must be installed as NuGet packages in the web project (the startup project of the solution):
<Project Sdk="Microsoft.NET.Sdk.Web">
<ItemGroup>
<!-- Orchard Core base -->
<PackageReference Include="OrchardCore.Application.Cms.Targets" Version="2.*" />
<!-- Third-party modules must be added to the web project -->
<PackageReference Include="CrestApps.OrchardCore.AI" Version="1.*" />
<PackageReference Include="Lombiq.HelpfulExtensions.OrchardCore" Version="1.*" />
</ItemGroup>
</Project>
For local project references to third-party modules:
<ItemGroup>
<!-- Local third-party module project reference in the web project -->
<ProjectReference Include="../ThirdParty.Module/ThirdParty.Module.csproj" />
</ItemGroup>