用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/umbraco/Umbraco-CMS-Backoffice-Skills --skill umbraco-collection-view命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 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-view |
| description | Implement collection views in Umbraco backoffice using official docs |
| version | 1.0.0 |
| location | managed |
| allowed-tools | Read, Write, Edit, WebFetch |
A Collection View defines how data is displayed within a collection. It allows you to create custom visual representations of entity lists - such as tables, grids, cards, or any custom layout. Collection views can be added to existing collections or custom ones, and users can switch between available views.
Always fetch the latest docs before implementing:
Context API: For accessing collection context and items data
umbraco-context-apiState Management: For subscribing to collection data changes
umbraco-state-managementUmbraco Element: For implementing the view element
umbraco-umbraco-elementimport type { ManifestCollectionView } from '@umbraco-cms/backoffice/extension-registry';
const manifest: ManifestCollectionView = {
type: 'collectionView',
alias: 'My.CollectionView.Cards',
name: 'Card View',
element: () => import('./card-view.element.js'),
meta: {
label: 'Cards',
icon: 'icon-grid',
pathName: 'cards',
},
conditions: [
{
alias: 'Umb.Condition.CollectionAlias',
match: 'My.Collection',
},
],
};
export const manifests = [manifest];
import { html, css, customElement, state } from '@umbraco-cms/backoffice/external/lit';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { UMB_COLLECTION_CONTEXT } from '@umbraco-cms/backoffice/collection';
@customElement('my-card-view')
export class MyCardViewElement extends UmbLitElement {
@state()
private _items: Array<any> = [];
constructor() {
super();
this.consumeContext(UMB_COLLECTION_CONTEXT, (context) => {
this.observe(context.items, (items) => {
this._items = items;
});
});
}
render() {
return html`
<div class="card-grid">
${this._items.map(
(item) => html`
< =>
)};
}
styles = css`;
}
;
{
{
: ;
}
}
import { html, css, customElement, state } from '@umbraco-cms/backoffice/external/lit';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import { UMB_COLLECTION_CONTEXT } from '@umbraco-cms/backoffice/collection';
@customElement('my-table-view')
export class MyTableViewElement extends UmbLitElement {
@state()
private _items: Array<any> = [];
constructor() {
super();
this.consumeContext(UMB_COLLECTION_CONTEXT, (context) => {
this.observe(context.items, (items) => {
this._items = items;
});
});
}
render() {
return html`
<uui-table>
<uui-table-head>
<uui-table-head-cell>Name</uui-table-head-cell>
Status
Updated
;
}
}
;
const manifest: ManifestCollectionView = {
type: 'collectionView',
alias: 'My.CollectionView.MediaThumbnails',
name: 'Thumbnail View',
element: () => import('./thumbnail-view.element.js'),
weight: 100, // Higher weight = appears first in view switcher
meta: {
label: 'Thumbnails',
icon: 'icon-picture',
pathName: 'thumbnails',
},
conditions: [
{
alias: 'Umb.Condition.CollectionAlias',
match: 'Umb.Collection.Media',
},
],
};
this.consumeContext(UMB_COLLECTION_CONTEXT, (context) => {
// Get configured columns/properties
this.observe(context.userDefinedProperties, (properties) => {
this._columns = properties;
});
// Get items
this.observe(context.items, (items) => {
this._items = items;
});
});
| Property | Description |
|---|---|
label | Display name in view switcher |
icon | Icon in view switcher |
pathName | URL path segment for deep linking |
Umb.Collection.DocumentUmb.Collection.MediaUmb.Collection.MemberUmb.Collection.UserThat's it! Always fetch fresh docs, keep examples minimal, generate complete working code.