umbraco-collection-action
Implement collection actions in Umbraco backoffice using official docs
What this skill does
# Umbraco Collection Action
## What is it?
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.
## Documentation
Always fetch the latest docs before implementing:
- **Main docs**: https://docs.umbraco.com/umbraco-cms/customizing/extending-overview/extension-types/collections
- **Collection View**: https://docs.umbraco.com/umbraco-cms/customizing/extending-overview/extension-types/collections/collection-view
- **Foundation**: https://docs.umbraco.com/umbraco-cms/customizing/foundation
- **Extension Registry**: https://docs.umbraco.com/umbraco-cms/customizing/extending-overview/extension-registry
## Related Foundation Skills
- **Context API**: For accessing collection context
- Reference skill: `umbraco-context-api`
- **Modals**: When actions open modal dialogs
- Reference skill: `umbraco-modals`
- **Conditions**: For controlling when actions appear
- Reference skill: `umbraco-conditions`
## Workflow
1. **Fetch docs** - Use WebFetch on the URLs above
2. **Ask questions** - What collection? What action to perform? Navigate or execute?
3. **Generate files** - Create manifest + action class based on latest docs
4. **Explain** - Show what was created and how to test
## Minimal Examples
### Manifest (manifests.ts)
```typescript
import 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];
```
### Action Implementation (create-action.ts)
```typescript
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;
```
### Link-based Action (using getHref)
```typescript
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;
```
### Action with Modal
```typescript
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;
```
### Action with Additional Options Indicator
```typescript
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',
},
],
};
```
### Action Class with Additional Options
```typescript
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;
```
## Meta Properties
| Property | Description |
|----------|-------------|
| `label` | Required. Button text |
| `href` | Optional static URL (use getHref() for dynamic) |
| `additionalOptions` | Shows dropdown indicator if true |
## Common Collection Aliases for Conditions
- `Umb.Collection.Document`
- `Umb.Collection.Media`
- `Umb.Collection.Member`
- `Umb.Collection.User`
- `Umb.Collection.DataType`
That's it! Always fetch fresh docs, keep examples minimal, generate complete working code.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.