用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/umbraco/Umbraco-CMS-Backoffice-Skills --skill umbraco-collection-action命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Run tests from skill examples and generate a report (project)
Validate links and references in SKILL.md files using deterministic scripts
Umbraco backoffice extension customisation - complete working examples showing how extension types combine
正在显示 SKILL.md
基于 SOC 职业分类
| name | umbraco-collection-action |
| description | Implement collection actions in Umbraco backoffice using official docs |
| version | 1.0.0 |
| location | managed |
| allowed-tools | Read, Write, Edit, WebFetch |
Collection Actions are buttons that appear in a collection's toolbar, providing actions that can be performed on the collection as a whole (not on individual items - those are Entity Bulk Actions). Common examples include "Create New" buttons or export functionality. Actions can either execute code or navigate to a URL.
Always fetch the latest docs before implementing:
Context API: For accessing collection context
umbraco-context-apiModals: When actions open modal dialogs
umbraco-modalsConditions: For controlling when actions appear
umbraco-conditionsimport type { ManifestCollectionAction } from '@umbraco-cms/backoffice/extension-registry';
const manifest: ManifestCollectionAction = {
type: 'collectionAction',
alias: 'My.CollectionAction.Create',
name: 'Create Item Action',
api: () => import('./create-action.js'),
meta: {
label: 'Create New',
},
conditions: [
{
alias: 'Umb.Condition.CollectionAlias',
match: 'My.Collection',
},
],
};
export const manifests = [manifest];
import { UmbCollectionActionBase } from '@umbraco-cms/backoffice/collection';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
export class CreateAction extends UmbCollectionActionBase {
constructor(host: UmbControllerHost) {
super(host);
}
async execute() {
// Perform the action
console.log('Create action executed');
}
}
export default CreateAction;
import { UmbCollectionActionBase } from '@umbraco-cms/backoffice/collection';
export class CreateLinkAction extends UmbCollectionActionBase {
async getHref() {
// Return URL to navigate to
return '/section/my-section/workspace/my-workspace/create';
}
async execute() {
// Not called when getHref returns a value
}
}
export default CreateLinkAction;
import { UmbCollectionActionBase } from '@umbraco-cms/backoffice/collection';
import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal';
export class ExportAction extends UmbCollectionActionBase {
async execute() {
const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT);
const modal = modalManager.open(this, MY_EXPORT_MODAL, {
data: {
collectionAlias: 'My.Collection',
},
});
await modal.onSubmit();
}
}
export default ExportAction;
const manifest: ManifestCollectionAction = {
type: 'collectionAction',
alias: 'My.CollectionAction.CreateWithOptions',
name: 'Create With Options',
api: () => import('./create-options-action.js'),
meta: {
label: 'Create',
additionalOptions: true, // Shows indicator that more options are available
},
conditions: [
{
alias: 'Umb.Condition.CollectionAlias',
match: 'Umb.Collection.Document',
},
],
};
import { UmbCollectionActionBase } from '@umbraco-cms/backoffice/collection';
export class CreateWithOptionsAction extends UmbCollectionActionBase {
async hasAdditionalOptions() {
return true;
}
async execute() {
// Show options menu or modal
}
}
export default CreateWithOptionsAction;
| Property | Description |
|---|---|
label | Required. Button text |
href | Optional static URL (use getHref() for dynamic) |
additionalOptions | Shows dropdown indicator if true |
Umb.Collection.DocumentUmb.Collection.MediaUmb.Collection.MemberUmb.Collection.UserUmb.Collection.DataTypeThat's it! Always fetch fresh docs, keep examples minimal, generate complete working code.