umbraco-extension-template by umbraco/umbraco-cms-backoffice-skills
npx skills add https://github.com/umbraco/umbraco-cms-backoffice-skills --skill umbraco-extension-templateUmbraco 扩展模板是用于创建后台扩展的官方 .NET 模板。它提供了一个预配置的项目结构,包含 TypeScript/Vite 工具链、正确的文件夹结构以及扩展开发所需的所有基本文件。每个 Umbraco 后台扩展都应从此模板开始。
在实施前请务必获取最新文档:
dotnet new install Umbraco.Templatesdotnet new umbraco-extension -n MyExtension广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
cd MyExtension/Client && npm installnpm run watchnpm run builddotnet new install Umbraco.Templates
dotnet new umbraco-extension -n MyExtension
dotnet new umbraco-extension -n MyExtension -ex
-ex 标志会添加示例代码,包括:
MyExtension/
├── MyExtension.csproj # .NET 项目文件
├── Constants.cs # 扩展常量
├── README.md # 设置说明
└── Client/ # TypeScript 源代码
├── package.json
├── tsconfig.json
├── vite.config.ts
└── src/
└── ... # 您的扩展代码
MyExtension/
├── MyExtension.csproj
├── Constants.cs
├── README.md
├── Composers/ # C# 组合器
│ └── SwaggerComposer.cs # API 文档设置
├── Controllers/ # C# API 控制器
│ └── MyExtensionController.cs
└── Client/
├── package.json
├── tsconfig.json
├── vite.config.ts
└── src/
├── api/ # 生成的 API 客户端
├── dashboards/ # 示例仪表板
└── entrypoints/ # 扩展入口点
# 导航到 Client 文件夹
cd MyExtension/Client
# 安装依赖项
npm install
# 开发模式,带热重载
npm run watch
# 生产构建
npm run build
# 类型检查
npm run check
dotnet publish --configuration Release
dotnet pack --configuration Release
运行模板后,在 Client/src/ 中添加您的第一个清单:
export const manifests: Array<UmbExtensionManifest> = [
{
name: "My Extension Entrypoint",
alias: "MyExtension.Entrypoint",
type: "backofficeEntryPoint",
js: () => import("./entrypoint.js"),
},
];
import type { UmbEntryPointOnInit } from "@umbraco-cms/backoffice/extension-api";
export const onInit: UmbEntryPointOnInit = (_host, _extensionRegistry) => {
console.log("Extension loaded!");
};
创建新扩展后,您必须将其作为项目引用添加到主 Umbraco 实例中。没有此步骤,扩展将不会加载。
参考技能:umbraco-add-extension-reference
此技能解释了如何将新扩展的 .csproj 文件作为 <ProjectReference> 添加到主 Umbraco 项目(例如 Umbraco-CMS.Skills.csproj)中。
创建扩展后,使用这些技能来添加功能:
umbraco-sectionsumbraco-dashboardumbraco-menuumbraco-workspaceumbraco-tree获取包含工作示例的完整扩展蓝图:
umbraco-backoffice就是这样!请务必获取最新文档,使用模板搭建项目,添加项目引用,然后根据需要添加扩展类型。
每周安装次数
80
代码仓库
GitHub 星标数
17
首次出现
2026年2月4日
安全审计
安装于
github-copilot56
opencode26
codex26
cursor25
gemini-cli24
amp22
The Umbraco Extension Template is the official .NET template for creating backoffice extensions. It provides a pre-configured project structure with TypeScript/Vite tooling, proper folder structure, and all essential files needed for extension development. Every Umbraco backoffice extension should start with this template.
Always fetch the latest docs before implementing:
dotnet new install Umbraco.Templatesdotnet new umbraco-extension -n MyExtensioncd MyExtension/Client && npm installnpm run watchnpm run builddotnet new install Umbraco.Templates
dotnet new umbraco-extension -n MyExtension
dotnet new umbraco-extension -n MyExtension -ex
The -ex flag adds example code including:
MyExtension/
├── MyExtension.csproj # .NET project file
├── Constants.cs # Extension constants
├── README.md # Setup instructions
└── Client/ # TypeScript source
├── package.json
├── tsconfig.json
├── vite.config.ts
└── src/
└── ... # Your extension code
MyExtension/
├── MyExtension.csproj
├── Constants.cs
├── README.md
├── Composers/ # C# composers
│ └── SwaggerComposer.cs # API documentation setup
├── Controllers/ # C# API controllers
│ └── MyExtensionController.cs
└── Client/
├── package.json
├── tsconfig.json
├── vite.config.ts
└── src/
├── api/ # Generated API client
├── dashboards/ # Example dashboard
└── entrypoints/ # Extension entry point
# Navigate to Client folder
cd MyExtension/Client
# Install dependencies
npm install
# Development with hot reload
npm run watch
# Production build
npm run build
# Type checking
npm run check
dotnet publish --configuration Release
dotnet pack --configuration Release
After running the template, add your first manifest in Client/src/:
export const manifests: Array<UmbExtensionManifest> = [
{
name: "My Extension Entrypoint",
alias: "MyExtension.Entrypoint",
type: "backofficeEntryPoint",
js: () => import("./entrypoint.js"),
},
];
import type { UmbEntryPointOnInit } from "@umbraco-cms/backoffice/extension-api";
export const onInit: UmbEntryPointOnInit = (_host, _extensionRegistry) => {
console.log("Extension loaded!");
};
After creating a new extension, you MUST add it as a project reference to the main Umbraco instance. Without this step, the extension will not load.
Reference skill:umbraco-add-extension-reference
This skill explains how to add the new extension's .csproj file as a <ProjectReference> in the main Umbraco project (e.g., Umbraco-CMS.Skills.csproj).
After creating your extension, use these skills to add functionality:
umbraco-sectionsumbraco-dashboardumbraco-menuumbraco-workspaceumbraco-treeFor complete extension blueprints with working examples:
umbraco-backofficeThat's it! Always fetch fresh docs, use the template to scaffold, add the project reference, then add extension types as needed.
Weekly Installs
80
Repository
GitHub Stars
17
First Seen
Feb 4, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot56
opencode26
codex26
cursor25
gemini-cli24
amp22
Kubernetes健康检查配置指南:.NET与Python应用探针设置
223 周安装