orchard-core-theming

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Orchard Core Theming

Orchard Core 主题开发

Use this skill for Orchard Core theming and content-definition/recipe work.
本技能适用于Orchard Core主题开发以及内容定义/Recipe相关工作。

How to use

使用方法

  • Path A (task match): scan the Tasks list; if the request matches, open
    references/TASK-MAP.md
    and go directly to the leaf files.
  • Path B (exploration): use the section cues to pick a reference section, open that section's
    INDEX.md
    , then choose the leaf file it points to.
  • Determine Razor vs Liquid early using the workflow in
    references/TASK-MAP.md
    . If it cannot be decided, fall back to Liquid and confirm with the user.
  • Open only the necessary leaf files; use a section
    INDEX.md
    only for orientation and discovery.
  • Prefer examples and ready-to-copy patterns.
  • 路径A(任务匹配):查看任务列表;如果请求匹配,打开
    references/TASK-MAP.md
    并直接访问对应的子文件。
  • 路径B(探索学习):根据章节提示选择参考章节,打开该章节的
    INDEX.md
    ,然后选择其指向的子文件。
  • 尽早通过
    references/TASK-MAP.md
    中的工作流确定使用Razor还是Liquid模板。如果无法确定,默认使用Liquid并与用户确认。
  • 仅打开必要的子文件;仅在需要定位和查找时使用章节的
    INDEX.md
  • 优先使用示例和可直接复制的代码模式。

Evidence rules

证据规则

  • Prefer repo evidence over assumptions: active theme, base theme,
    placement.json
    , and existing templates.
  • Trace the shape model first when it is unclear; use
    references/TASK-MAP.md
    to find shape tracing guidance and ask the user if needed.
  • Confirm unknown part/field properties in
    ContentDefinition.json
    (or
    OrchardCore.db
    ) and the relevant field references.
  • Ask for missing identifiers (content type, part name, field name, display type) instead of inventing them.
  • Do not invent recipe steps or feature IDs; use
    references/TASK-MAP.md
    to find the right recipe references.
  • 优先使用仓库中的实际证据而非假设:包括当前主题、基础主题、
    placement.json
    以及现有模板。
  • 当内容不明确时,首先追踪形状模型;使用
    references/TASK-MAP.md
    中的形状追踪指南,必要时向用户询问。
  • ContentDefinition.json
    (或
    OrchardCore.db
    )及相关字段参考中确认未知的部件/字段属性。
  • 若缺少标识符(内容类型、部件名称、字段名称、显示类型),请向用户询问,不要自行编造。
  • 不要自行创建Recipe步骤或功能ID;使用
    references/TASK-MAP.md
    查找正确的Recipe参考内容。

Scripts

脚本工具

Use these scripts instead of hand-building extracts.
  • scripts/extract-content-definitions.py
    to extract content types/parts/fields from
    ContentDefinition.json
    or
    OrchardCore.db
    , with optional related-type expansion and Markdown/JSON output. See
    references/50-content-model/CONTENT-DEFINITIONS-EXTRACTOR.md
    .
  • scripts/extract-content-items.py
    to get content items from
    OrchardCore.db
    , filter by type/IDs/text, and optionally emit a recipe
    content
    step or a Markdown/JSON extract. See
    references/50-content-model/CONTENT-ITEMS-EXTRACTOR.md
    .
  • scripts/generate-orchard-ids.py
    to generate Orchard Core IDs that match the
    DefaultIdGenerator
    alphabet for stable
    ContentItemId
    values in recipes. See
    references/70-recipes/ID-GENERATION.md
    .
  • scripts/sync-skill.py
    to refresh the entire skill folder from the Lombiq/Orchard-Core-Agent-Skills repo (references, scripts, SKILL.md, assets). The running script is not overwritten until the next sync.
Sync example:
bash
python skills/orchard-core-theming/scripts/sync-skill.py
使用以下脚本替代手动提取内容:
  • scripts/extract-content-definitions.py
    :从
    ContentDefinition.json
    OrchardCore.db
    中提取内容类型/部件/字段,支持可选的相关类型扩展以及Markdown/JSON格式输出。详情请查看
    references/50-content-model/CONTENT-DEFINITIONS-EXTRACTOR.md
  • scripts/extract-content-items.py
    :从
    OrchardCore.db
    中获取内容项,可按类型/ID/文本过滤,还可选择性生成Recipe的
    content
    步骤或Markdown/JSON格式的提取内容。详情请查看
    references/50-content-model/CONTENT-ITEMS-EXTRACTOR.md
  • scripts/generate-orchard-ids.py
    :生成符合
    DefaultIdGenerator
    字母表的Orchard Core ID,用于Recipe中生成稳定的
    ContentItemId
    值。详情请查看
    references/70-recipes/ID-GENERATION.md
  • scripts/sync-skill.py
    :从Lombiq/Orchard-Core-Agent-Skills仓库刷新整个技能文件夹(包括参考文档、脚本、SKILL.md、资源文件)。当前运行的脚本将在下一次同步时才会被覆盖。
同步示例:
bash
python skills/orchard-core-theming/scripts/sync-skill.py

Reference section cues

参考章节提示

Use these cues to decide which reference section to open.
  • Use
    references/10-understand-structure/
    to confirm solution and theme structure (manifests, base theme), create themes, and locate layouts/zones.
  • Use
    references/20-shapes-placement/
    to find shape names, alternates, placement rules, and override workflow steps.
  • Use
    references/30-razor/
    to implement Razor theme changes with tag helpers, shape rendering, and IOrchardHelper.
  • Use
    references/40-liquid/
    to implement Liquid theme changes with tags, filters, and shape helpers.
  • Use
    references/50-content-model/
    to inspect content definitions/items, parts/fields, settings/containers, and the extractors.
  • Use
    references/60-assets-resources/
    to include scripts/styles and manage resources and static files.
  • Use
    references/70-recipes/
    to author, validate, and reuse recipes for setup, definitions, and content import.
  • Use
    references/80-debugging-discovery/
    to trace shapes, inspect logs, and find evidence in source.
  • Use
    references/90-glossary/
    to resolve terms and acronyms in Orchard Core theming docs.
使用以下提示决定打开哪个参考章节:
  • 使用
    references/10-understand-structure/
    确认解决方案和主题结构(清单、基础主题)、创建主题以及定位布局/区域。
  • 使用
    references/20-shapes-placement/
    查找形状名称、替代模板、布局规则以及重写工作流步骤。
  • 使用
    references/30-razor/
    通过标签助手、形状渲染和IOrchardHelper实现Razor主题修改。
  • 使用
    references/40-liquid/
    通过标签、过滤器和形状助手实现Liquid主题修改。
  • 使用
    references/50-content-model/
    检查内容定义/项、部件/字段、设置/容器以及提取工具。
  • 使用
    references/60-assets-resources/
    添加脚本/样式并管理资源和静态文件。
  • 使用
    references/70-recipes/
    编写、验证和复用用于安装设置、定义导入和内容导入的Recipe。
  • 使用
    references/80-debugging-discovery/
    追踪形状、检查日志以及在源码中查找证据。
  • 使用
    references/90-glossary/
    解析Orchard Core主题开发文档中的术语和缩写。

Tasks

任务列表

Use this list to decide whether to open
references/TASK-MAP.md
for the exact leaf files.
  • Determine template language (Razor vs Liquid).
  • Add or update a content type/part/field in ContentDefinition.json.
  • Extract a focused content definition slice (large JSON).
  • Create a setup recipe.
  • Add content types and sample content to a recipe.
  • Create or update workflows in a recipe.
  • Create or override a content item shape template.
  • Implement or override OrchardCore.Forms widgets and Form content.
  • Inspect real content items (SQLite).
  • Update a shape after adding fields.
  • Render BagPart/FlowPart/ListPart items.
  • Add scripts/styles and include them in the layout.
  • Find shape alternates and placement rules.
  • Find evidence in Orchard Core source.
  • Work on theme structure or layout.
  • Understand solution structure.
使用此列表决定是否打开
references/TASK-MAP.md
以获取对应的子文件:
  • 确定模板语言(Razor vs Liquid)。
  • 在ContentDefinition.json中添加或更新内容类型/部件/字段。
  • 提取聚焦的内容定义片段(大型JSON)。
  • 创建安装设置Recipe。
  • 向Recipe中添加内容类型和示例内容。
  • 在Recipe中创建或更新工作流。
  • 创建或重写内容项形状模板。
  • 实现或重写OrchardCore.Forms小部件和表单内容。
  • 检查实际内容项(SQLite)。
  • 添加字段后更新形状。
  • 渲染BagPart/FlowPart/ListPart项。
  • 添加脚本/样式并将其包含在布局中。
  • 查找形状替代模板和布局规则。
  • 在Orchard Core源码中查找证据。
  • 处理主题结构或布局。
  • 理解解决方案结构。