Generates code and configuration for Orchard Core ListPart: list content types, ContainedPart, PagerSlim cursor paging, Liquid filters, Razor templates, RSS feeds, GraphQL, and blog/collection patterns.
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 list-based content types using ListPart in Orchard Core.
OrchardCore.Lists module and associates child content items with a parent container.ContainedPart, unlike BagPart which embeds items inline.ContainedContentTypes in ListPartSettings to restrict which content types can be added to the list.EnableOrdering in ListPartSettings for drag-and-drop reordering.PageSize in ListPartSettings (default 10) to control pagination. By default the front-end list uses the cursor-based PagerSlim (newer/older links, before/after query values); set ShowFullPager = true for a numbered Pager (page query value).pageSize query string; any other value falls back to the list's PageSize.list_items and list_count Liquid filters to load list items in templates.ContainedPart with ListContentItemId, ListContentType, and Order, indexed in ContainedPartIndex.{ "steps": [...] }.sealed modifier except View Models.{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Lists"
],
"disable": []
}
]
}
public sealed class Migrations : DataMigration
{
private readonly IContentDefinitionManager _contentDefinitionManager;
public Migrations(IContentDefinitionManager contentDefinitionManager)
{
_contentDefinitionManager = contentDefinitionManager;
}
public async Task<int> CreateAsync()
{
await _contentDefinitionManager.AlterTypeDefinitionAsync("Blog", type => type
.Creatable()
.Listable()
.WithPart("TitlePart", part => part.WithPosition("0"))
.WithPart("AutoroutePart", part => part
.WithPosition("1")
.WithSettings(new AutoroutePartSettings
{
Pattern = "{{ Model.ContentItem | display_text | slugify }}",
})
)
.WithPart("ListPart", part => part
.WithPosition("2")
.WithSettings(new ListPartSettings
{
PageSize = 10,
EnableOrdering = true,
ContainedContentTypes = ["BlogPost"],
})
)
);
await _contentDefinitionManager.AlterTypeDefinitionAsync("BlogPost", type => type
.Draftable()
.Versionable()
.WithPart("TitlePart", part => part.WithPosition("0"))
.WithPart("AutoroutePart", part => part
.WithPosition("1")
.WithSettings(new AutoroutePartSettings
{
Pattern = "{{ Model.ContentItem | container | display_text | slugify }}/{{ Model.ContentItem | display_text | slugify }}",
})
)
.WithPart("HtmlBodyPart", part => part
.WithPosition("2")
.WithEditor("Trumbowyg")
)
);
return 1;
}
}
| Property | Type | Description |
|---|---|---|
ListPart | ListPart | The ListPart instance |
ContentItems | IEnumerable<ContentItem> | The content items the list contains |
ContainedContentTypeDefinitions | IEnumerable<ContentTypeDefinition> | The content types the list accepts |
Context | BuildPartDisplayContext | The current display context |
Pager | dynamic | The pager shape for pagination |
ListPartViewModel also exposes EnableOrdering, IsOrdering, ListPartFilterViewModel, and (in the admin) the List AdminListContext.
| Property | Type | Description |
|---|---|---|
PageSize | int | Number of content items per page (default 10) |
EnableOrdering | bool | Enable drag-and-drop ordering of items |
ContainedContentTypes | string[] | Content types that may be contained by this list |
ShowHeader | bool | Show a header for the owning (container) content in the admin list |
ShowFullPager | bool | Use the numbered Pager instead of PagerSlim |
PagerSlim (default) renders Newer/Older links for cursor-based paging, like the Blog recipe's post list.ShowFullPager, the shape is a numbered Pager built from the total item count.Pager_PageSizeSelector shape when Page size selection is enabled (General settings, allowed sizes default 10, 25, 50, 100). The selected pageSize is carried in pager links. Style it by overriding Pager_PageSizeSelector (model has PageSizes and CurrentPageSize).pagerOptions.GetPageSize(pagerParameters.PageSize, settings.PageSize), and PagerSlimParameters.PageSize now carries the requested size.The list's contained items in the admin are rendered through the shared AdminList shape, so they follow the site's List or Grid layout. With EnableOrdering, an unfiltered admin list of the latest versions with more than one item forces the List layout and hides the layout selector; drag a row's handle to reorder (saved immediately). Searching or filtering disables drag ordering and restores normal layout selection. The List items button names the contained content type.
On the admin create and edit pages of a contained item, ContainerBreadcrumbProvider (Lists feature) puts the container in the breadcrumb in place of the content type item (id Container, the container's display text or its localized type name, linking to its display page with ViewContent), for example Dashboard / Manage Content / Blog / New Blog Post. A create page finds the container from the ListPart.ContainerId query value.
list_items - Load Published List ItemsThe list_items filter loads published content items for a given content item or content item ID:
{% assign blogPosts = Model.ContentItem | list_items %}
{% for post in blogPosts %}
{{ post | shape_build_display: "Summary" | shape_render }}
{% endfor %}
Load by content item ID:
{% assign blogPosts = "4j42fxryjcpqkkacmg6cwz3pr5" | list_items %}
{% for post in blogPosts %}
<h2>{{ post.DisplayText }}</h2>
{% endfor %}
list_count - Count Published List Items{% assign count = Model.ContentItem | list_count %}
<p>Total posts: {{ count }}</p>
Override the list rendering for a specific content type by creating a template named Blog-ListPart.liquid:
{% for item in Model.ContentItems %}
{{ item | shape_build_display: "Summary" | shape_render }}
{% endfor %}
{% assign previousText = "Newer Posts" | t %}
{% assign nextText = "Older Posts" | t %}
{% assign previousClass = "previous" %}
{% assign nextClass = "next" %}
{% shape_pager Model.Pager previous_text: previousText, next_text: nextText,
previous_class: previousClass, next_class: nextClass %}
{{ Model.Pager | shape_render }}
Create a file named Blog-ListPart.cshtml:
@model OrchardCore.Lists.ViewModels.ListPartViewModel
@foreach (var item in Model.ContentItems)
{
var shape = await ContentItemDisplayManager.BuildDisplayAsync(item, Model.Context.Updater, "Summary");
@await DisplayAsync(shape)
}
@await DisplayAsync(Model.Pager)
| Template Name | Filename | Description |
|---|---|---|
ListPart | ListPart.cshtml | Default ListPart shape |
Blog__ListPart | Blog-ListPart.cshtml | ListPart for Blog content type only |
Blog_Summary__ListPart | Blog-ListPart.Summary.cshtml | ListPart for Blog in Summary display type |
ListPartFeed | ListPartFeed.cshtml | RSS feed shape for ListPart |
The OrchardCore.Lists module provides IOrchardHelper helpers for querying list items programmatically:
| Method | Description |
|---|---|
QueryListItemsCountAsync(listContentItemId, itemPredicate = null) | Count of contained items matching an optional ContentItemIndex predicate |
QueryListItemsAsync(listContentItemId, itemPredicate = null) | Contained items matching an optional ContentItemIndex predicate |
@{
var recent = await Orchard.QueryListItemsAsync(blogId, x => x.Published && x.CreatedUtc > DateTime.UtcNow.AddDays(-30));
}
Liquid also provides the container filter ({{ Model.ContentItem | container }}) to load the parent list of a contained item.
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Records;
using OrchardCore.Lists.Indexes;
using YesSql;
var posts = await _session.Query<ContentItem>()
.With<ContainedPartIndex>(x => x.ListContentItemId == blogId)
.With<ContentItemIndex>(x => x.Published)
.OrderByDescending(x => x.CreatedUtc)
.Take(10)
.ListAsync();
ContainedPartIndex stores ListContentItemId, ListContentType, ContentItemId, Order, Published, Latest, and DisplayText. It declares SingleRecordPerDocument() and ExclusiveToDocumentType() (YesSql 6.3), so a query joining only ContentItemIndex and ContainedPartIndex isn't grouped by document and its count doesn't join Document; joining another multi-record index (such as TaxonomyIndex) brings the grouping back. IContainerService (OrchardCore.Lists.Services) provides GetItemCountAsync(listContentItemId, ContainedItemOptions), QueryContainedItemsAsync(...) with a Pager or PagerSlim, GetNextOrderNumberAsync, and UpdateContentItemOrdersAsync. ContainedItemOptions.Status is Published (default), Latest, Draft, or Owner.
OrchardCore.Feeds enabled, each list exposes an RSS feed at /Contents/Lists/{contentItemId}/rss; see orchardcore-feeds for DisableRssFeed, FeedProxyUrl, and FeedItemsCount.listPart { contentItems(first: 10, skip: 0) { ... } } returns published contained items, and containedPart: { listContentItemId: "..." } can be used in where filters of the contained type.Every content item contained in a list has a ContainedPart with indexable properties:
| Index Field | Description |
|---|---|
Content.ContentItem.ContainedPart.ListContentItemId | The parent list content item ID |
Content.ContentItem.ContainedPart.Order | The display order of the item |
These are the field names in full-text indexes (Lucene, Elasticsearch, Azure AI Search).
{
"steps": [
{
"name": "Content",
"data": [
{
"ContentItemId": "4j42fxryjcpqkkacmg6cwz3pr5",
"ContentType": "Blog",
"DisplayText": "My Blog",
"Latest": true,
"Published": true,
"TitlePart": {
"Title": "My Blog"
},
"AutoroutePart": {
"Path": "blog"
}
},
{
"ContentItemId": "[js:uuid()]",
"ContentType": "BlogPost",
"DisplayText": "First Post",
"Latest": true,
"Published": true,
"TitlePart": {
"Title": "First Post"
},
"HtmlBodyPart": {
"Html": "<p>Welcome to my first blog post!</p>"
},
"ContainedPart": {
"ListContentItemId": "4j42fxryjcpqkkacmg6cwz3pr5",
"Order": 0
}
}
]
}
]
}
Official Orchard Core videos shown on the documentation page:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
orchard-core, listpart, containedpart, pagerslim, liquid-filters, blog-patterns
/orchardcore:orchardcore-listsfrom 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