Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions 16/umbraco-cms/.gitbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ redirects:
customizing/foundation/working-with-data/repositories: customizing/foundation/repositories.md
customizing/foundation/working-with-data/states: customizing/foundation/states.md
customizing/foundation/working-with-data/store: customizing/foundation/README.md
customizing/extending-overview/extension-types/workspaces/workspace-action-menu-item: customizing/extending-overview/extension-types/workspaces/workspace-action-menu-items.md
customizing/extending-overview/extension-types/workspaces/workspace-footer-app: customizing/extending-overview/extension-types/workspaces/workspace-footer-apps.md
reference/notifications/editormodel-notifications/customizing-the-links-box: reference/notifications/editormodel-notifications/README.md
fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/blocks: fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/README.md
tutorials/creating-a-custom-dashboard: tutorials/creating-a-custom-dashboard/README.md
Expand Down
16 changes: 16 additions & 0 deletions 16/umbraco-cms/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,22 @@
* [Extension Manifest](customizing/extending-overview/extension-registry/extension-manifest.md)
* [Replace, Exclude or Unregister](customizing/extending-overview/extension-registry/replace-exclude-or-unregister.md)
* [Extension Types](customizing/extending-overview/extension-types/README.md)
* [Sections](customizing/extending-overview/extension-types/sections/README.md)
* [Sections](customizing/extending-overview/extension-types/sections/section.md)
* [Section Sidebar](customizing/extending-overview/extension-types/sections/section-sidebar.md)
* [Section View](customizing/extending-overview/extension-types/sections/section-view.md)
* [Workspaces](customizing/extending-overview/extension-types/workspaces/README.md)
* [Workspace Actions](customizing/extending-overview/extension-types/workspaces/workspace-editor-actions.md)
* [Workspace Action Menu Items](customizing/extending-overview/extension-types/workspaces/workspace-action-menu-items.md)
* [Workspace Context](customizing/extending-overview/extension-types/workspaces/workspace-context.md)
* [Workspace Views](customizing/extending-overview/extension-types/workspaces/workspace-views.md)
* [Workspace Footer Apps](customizing/extending-overview/extension-types/workspaces/workspace-footer-apps.md)
* [Menu](customizing/extending-overview/extension-types/menu.md)
* [Header Apps](customizing/extending-overview/extension-types/header-apps.md)
* [Icons](customizing/extending-overview/extension-types/icons.md)
* [Block Custom View](customizing/extending-overview/extension-types/block-custom-view.md)
* [Bundle](customizing/extending-overview/extension-types/bundle.md)
* [Kind](customizing/extending-overview/extension-types/kind.md)
* [App Entry Point](customizing/extending-overview/extension-types/app-entry-point.md)
* [Backoffice Entry Point](customizing/extending-overview/extension-types/backoffice-entry-point.md)
* [Block Custom View](customizing/extending-overview/extension-types/block-custom-view.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,50 @@
---
description: >-
An overview of the available extension types related to workspaces.
Learn about workspace extension types that provide shared functionality and communication within workspace environments.
---

# Extension Types: Workspaces

Workspace extensions are specialized components that enhance Umbraco's editing environments for documents, media, and members. They share state through workspace contexts, enabling coordinated functionality like synchronized actions, real-time status updates, and seamless data flow between different parts of the editing interface.

Check warning on line 8 in 16/umbraco-cms/customizing/extending-overview/extension-types/workspaces/README.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐢 [UmbracoDocs.SentenceLength] Write shorter sentences (less than 25 words). For content inside note or warning blocks, add blank lines around the content. Raw Output: {"message": "[UmbracoDocs.SentenceLength] Write shorter sentences (less than 25 words). For content inside note or warning blocks, add blank lines around the content.", "location": {"path": "16/umbraco-cms/customizing/extending-overview/extension-types/workspaces/README.md", "range": {"start": {"line": 8, "column": 128}}}, "severity": "WARNING"}

## Available Extension Types

Workspace extensions can be grouped into these types:

### Core Extensions
- **[Workspace Context](workspace-context.md)** - Provides shared state management and communication between workspace extensions
- **[Workspace](workspace.md)** - Defines the main workspace environment and routing

### User Interface Extensions
- **[Workspace Views](workspace-views.md)** - Tab-based content areas for organizing different aspects of entity editing
- **[Workspace Footer Apps](workspace-footer-apps.md)** - Persistent status information and contextual data in the footer area

### Action Extensions
- **[Workspace Actions](workspace-editor-actions.md)** - Primary action buttons that appear in the workspace footer
- **[Workspace Action Menu Items](workspace-action-menu-items.md)** - Dropdown menu items that extend workspace actions with additional functionality

## Integration Patterns

Workspace extensions communicate through shared contexts using these patterns:

1. **[Workspace Context](workspace-context.md)** manages centralized state using observables that automatically notify subscribers of changes
2. **[Workspace Actions](workspace-editor-actions.md)** consume the context to modify state when users interact with buttons or menu items
3. **[Workspace Actions Menu Items](workspace-action-menu-items.md)** add additional options for workspace actions
4. **[Workspace Views](workspace-views.md)** observe context state to automatically update their UI when data changes
5. **[Footer Apps](workspace-footer-apps.md)** monitor context state to display real-time status information

### Communication Flow

```
Workspace Context (State Management)
↕️
Workspace Actions (State Modification)
↕️
Workspace Views (State Display)
↕️
Footer Apps (Status Monitoring)
```

{% hint style="info" %}
All workspace extensions are automatically scoped to their workspace instance, ensuring that extensions in different workspaces cannot interfere with each other.
{% endhint %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
description: >-
Learn how to create workspace action menu items that extend workspace actions with additional functionality.
---

# Workspace Action Menu Item

Workspace Action Menu Items extend existing workspace actions by adding dropdown menu options. They provide secondary functionality that relates to the primary action without cluttering the workspace footer.

## Manifest

{% code caption="manifest.ts" %}
```typescript
{
type: 'workspaceActionMenuItem',
kind: 'default',
alias: 'example.workspaceActionMenuItem.resetCounter',
name: 'Reset Counter Menu Item',
api: () => import('./reset-counter-menu-item.action.js'),
forWorkspaceActions: 'example.workspaceAction.incrementor',
weight: 100,
meta: {
label: 'Reset Counter',
icon: 'icon-refresh',
},
}
```
{% endcode %}

### Key Properties
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default kind should be mentioned here as well, as thata gives the Element for this.

- **`forWorkspaceActions`** - Specifies which workspace action this extends
- **`weight`** - Controls ordering within the dropdown menu
- **`meta.label`** - Text displayed in dropdown
- **`meta.icon`** - Icon displayed alongside label

## Implementation

Create a workspace action menu item by extending `UmbWorkspaceActionMenuItemBase` and implementing the `execute` method. This provides the functionality that runs when users interacts with the menu item:

{% code caption="reset-counter-menu-item.action.ts" %}
```typescript
import { EXAMPLE_COUNTER_CONTEXT } from './counter-workspace-context.js';
import { UmbWorkspaceActionMenuItemBase } from '@umbraco-cms/backoffice/workspace';
import type { UmbWorkspaceActionMenuItem } from '@umbraco-cms/backoffice/workspace';

export class ExampleResetCounterMenuItemAction extends UmbWorkspaceActionMenuItemBase implements UmbWorkspaceActionMenuItem {
override async execute() {
const context = await this.getContext(EXAMPLE_COUNTER_CONTEXT);
if (!context) {
throw new Error('Could not get the counter context');
}

context.reset();
}
}

export const api = ExampleResetCounterMenuItemAction;
```
{% endcode %}

## Action Relationship

Menu items display a dropdown menu for their associated actions:

### Primary Action
```typescript
// The main action that appears as a button
{
type: 'workspaceAction',
alias: 'example.workspaceAction.save',
meta: { label: 'Save' },
}
```

### Menu Item Extensions
```typescript
// Multiple menu items can extend the same action
{
type: 'workspaceActionMenuItem',
alias: 'example.menuItem.saveAndClose',
forWorkspaceActions: 'example.workspaceAction.save',
meta: { label: 'Save and Close' },
}

{
type: 'workspaceActionMenuItem',
alias: 'example.menuItem.saveAsDraft',
forWorkspaceActions: 'example.workspaceAction.save',
meta: { label: 'Save as Draft' },
}
```
Loading
Loading