You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Document workspaceActionMenuItem kinds (default and previewOption)
Added comprehensive documentation for the 'kind' property in workspace action menu items:
- Documented the 'default' kind with api property and getHref()/execute() methods
- Documented the new 'previewOption' kind for custom preview environments
- Added example manifest for previewOption with urlProviderAlias
- Linked to server-side IUrlProvider documentation in Content Delivery API section
Related to Umbraco-CMS PR #20391
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: 17/umbraco-cms/customizing/extending-overview/extension-types/workspaces/workspace-action-menu-items.md
+55-3Lines changed: 55 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,58 @@ Workspace Action Menu Items extend existing workspace actions by adding dropdown
34
34
-**`meta.label`** - Text displayed in dropdown
35
35
-**`meta.icon`** - Icon displayed alongside label
36
36
37
+
## Kinds
38
+
39
+
The `kind` property determines the behavior and purpose of the workspace action menu item. Each kind provides specialized functionality for different use cases.
40
+
41
+
### default
42
+
43
+
The `default` kind provides standard menu item functionality for executing custom actions.
44
+
45
+
**Properties:**
46
+
-**`api`** - Class that extends `UmbWorkspaceActionMenuItemBase` and implements either `execute()` or `getHref()` method
47
+
-**`meta.label`** - Text displayed in the menu item
48
+
-**`meta.icon`** - Optional icon displayed alongside the label
49
+
50
+
The API class either provides a `getHref()` method or an `execute()` method. If the `getHref()` method is provided, the action will open the returned URL. Otherwise, the `execute()` method will be run when the menu item is clicked.
51
+
52
+
**Use case:** General purpose menu items that execute custom logic or navigate to a URL when clicked.
53
+
54
+
### previewOption
55
+
56
+
The `previewOption` kind creates menu items for document preview scenarios, integrating with server-side URL providers to generate preview URLs for different environments.
57
+
58
+
**Properties:**
59
+
-**`meta.label`** - Text displayed in the menu item
60
+
-**`meta.icon`** - Icon displayed alongside the label
61
+
-**`meta.urlProviderAlias`** - Alias of the server-side `IUrlProvider` that generates the preview URL
62
+
63
+
**Use case:** Custom preview options that open documents in different preview environments (staging, production, custom domains).
The `previewOption` kind requires a server-side `IUrlProvider` to be registered with the matching `urlProviderAlias`. The provider generates the preview URL when the menu item is clicked.
85
+
86
+
Learn more about implementing server-side URL providers in the [Additional preview environments support](../../../../reference/content-delivery-api/additional-preview-environments-support.md) article.
87
+
{% endhint %}
88
+
37
89
## Implementation
38
90
39
91
Create a workspace action menu item by extending `UmbWorkspaceActionMenuItemBase` and implementing the `execute` method. This provides the functionality that runs when a user interacts with the menu item:
@@ -50,7 +102,7 @@ export class ExampleResetCounterMenuItemAction extends UmbWorkspaceActionMenuIte
50
102
if (!context) {
51
103
thrownewError('Could not get the counter context');
52
104
}
53
-
105
+
54
106
context.reset();
55
107
}
56
108
}
@@ -84,9 +136,9 @@ Menu items display a dropdown menu for their associated actions:
0 commit comments