Skip to main content
AI/MLCrestApps

orchardcore-taxonomies

Skill for creating and managing taxonomies in Orchard Core. Covers taxonomy creation, taxonomy terms, taxonomy fields, and taxonomy-based content organization. Use this skill when requests mention Orchard Core Taxonomies, Create and Manage Taxonomies, Enabling Taxonomy Features, Creating a Taxonomy via Recipe, Hierarchical Terms (Nested), Attaching TaxonomyField to a Content Type, or closely related Orchard Core implementation, setup, extension, or troubleshooting work. Strong matches include work with OrchardCore.Taxonomies, TaxonomyField, TermPart, TitlePart, AliasPart, TaxonomyPart, AlterPartDefinition, WithField, WithSettings, TaxonomyFieldSettings, AlterTypeDefinition, WithPart. It also helps with taxonomy examples, Hierarchical Terms (Nested), Attaching TaxonomyField to a Content Type, Querying by Taxonomy Terms in Liquid, plus the code patterns, admin flows, recipe steps, and referenced examples captured in this skill.

Stars
13
Source
CrestApps/CrestApps.AgentSkills
Updated
2026-05-29
Slug
CrestApps--CrestApps.AgentSkills--orchardcore-taxonomies
View on GitHubRaw SKILL.md

// install — copy + paste into any project

mkdir -p .claude/skills && curl -fsSL https://raw.githubusercontent.com/CrestApps/CrestApps.AgentSkills/HEAD/plugins/orchardcore/skills/orchardcore-taxonomies/SKILL.md -o .claude/skills/orchardcore-taxonomies.md

Drops the SKILL.md into .claude/skills/orchardcore-taxonomies.md. Works with Claude Code, Cursor, and any agent that loads SKILL.md files from .claude/skills/.

Orchard Core Taxonomies - Prompt Templates

Create and Manage Taxonomies

You are an Orchard Core expert. Generate taxonomy definitions, terms, and taxonomy field configurations.

Guidelines

  • Enable OrchardCore.Taxonomies to use taxonomy features.
  • A Taxonomy is a content item of type Taxonomy that contains terms.
  • Terms are hierarchical content items within a taxonomy.
  • Use TaxonomyField on content types to allow categorization.
  • Taxonomies can be flat (tags) or hierarchical (categories).
  • Terms can have custom content parts and fields.
  • TermPart is welded automatically onto content items used as taxonomy terms; do not attach it manually.
  • Taxonomy content listings use full pagination in Orchard Core 3.0.

Enabling Taxonomy Features

{
  "steps": [
    {
      "name": "Feature",
      "enable": [
        "OrchardCore.Taxonomies"
      ],
      "disable": []
    }
  ]
}

Creating a Taxonomy via Recipe

{
  "steps": [
    {
      "name": "Content",
      "data": [
        {
          "ContentItemId": "{{TaxonomyId}}",
          "ContentType": "Taxonomy",
          "DisplayText": "{{TaxonomyName}}",
          "Latest": true,
          "Published": true,
          "TitlePart": {
            "Title": "{{TaxonomyName}}"
          },
          "AliasPart": {
            "Alias": "{{taxonomy-alias}}"
          },
          "TaxonomyPart": {
            "Terms": [
              {
                "ContentItemId": "{{TermId1}}",
                "ContentType": "{{TermContentType}}",
                "DisplayText": "{{TermName1}}",
                "TitlePart": {
                  "Title": "{{TermName1}}"
                }
              },
              {
                "ContentItemId": "{{TermId2}}",
                "ContentType": "{{TermContentType}}",
                "DisplayText": "{{TermName2}}",
                "TitlePart": {
                  "Title": "{{TermName2}}"
                }
              }
            ],
            "TermContentType": "{{TermContentType}}"
          }
        }
      ]
    }
  ]
}

Hierarchical Terms (Nested)

{
  "ContentItemId": "term-parent",
  "ContentType": "Category",
  "DisplayText": "Parent Category",
  "TitlePart": {
    "Title": "Parent Category"
  },
  "Terms": [
    {
      "ContentItemId": "term-child-1",
      "ContentType": "Category",
      "DisplayText": "Child Category 1",
      "TitlePart": {
        "Title": "Child Category 1"
      }
    },
    {
      "ContentItemId": "term-child-2",
      "ContentType": "Category",
      "DisplayText": "Child Category 2",
      "TitlePart": {
        "Title": "Child Category 2"
      }
    }
  ]
}

Attaching TaxonomyField to a Content Type

_contentDefinitionManager.AlterPartDefinition("BlogPost", part => part
    .WithField("Categories", field => field
        .OfType("TaxonomyField")
        .WithDisplayName("Categories")
        .WithSettings(new TaxonomyFieldSettings
        {
            TaxonomyContentItemId = "{{TaxonomyContentItemId}}",
            Unique = false,
            LeavesOnly = false
        })
        .WithPosition("0")
    )
    .WithField("Tags", field => field
        .OfType("TaxonomyField")
        .WithDisplayName("Tags")
        .WithEditor("Tags")
        .WithSettings(new TaxonomyFieldSettings
        {
            TaxonomyContentItemId = "{{TagsTaxonomyContentItemId}}"
        })
        .WithPosition("1")
    )
);

Querying by Taxonomy Terms in Liquid

Create a SQL query named ContentItemsByTaxonomyTerm with Return Content Items disabled:

SELECT DISTINCT ContentItemId
FROM TaxonomyIndex
WHERE TermContentItemId = @termContentItemId:''
  AND Published = true

Execute the query, then load its returned content item ids with the content_item_id filter:

{% assign rows = Queries.ContentItemsByTaxonomyTerm | query: termContentItemId: termId %}
{% assign contentItemIds = rows | map: "ContentItemId" %}
{% assign items = contentItemIds | content_item_id %}

{% for item in items %}
    {{ item | display_text }}
{% endfor %}

Filtering Taxonomy Content Listings

Implement IContentsTaxonomyListFilter when a module must add restrictions to the query used by a taxonomy term content listing. Keep the filter focused on query constraints and let the built-in listing handle paging.

Displaying Taxonomy Terms

{% assign terms = Model.ContentItem.Content.BlogPost.Categories | taxonomy_terms %}
{% for term in terms %}
    <span class="badge">{{ term.DisplayText }}</span>
{% endfor %}

Custom Term Content Type

Create a custom term type with additional fields:

await _contentDefinitionManager.AlterTypeDefinitionAsync("Category", type => type
    .DisplayedAs("Category")
    .WithPart("TitlePart")
    .WithPart("Category", part => part
        .WithPosition("1")
    )
);

await _contentDefinitionManager.AlterPartDefinitionAsync("Category", part => part
    .WithField("Icon", field => field
        .OfType("TextField")
        .WithDisplayName("Icon CSS Class")
        .WithPosition("0")
    )
    .WithField("Description", field => field
        .OfType("TextField")
        .WithDisplayName("Description")
        .WithEditor("TextArea")
        .WithPosition("1")
    )
);