Skip to content

Commit e22d974

Browse files
authored
Merge pull request #7576 from umbraco/merge-v16-changes-to-v17
Cherry pick changes from v16 to v17
2 parents c98d2e4 + 99837b0 commit e22d974

File tree

7 files changed

+38
-93
lines changed

7 files changed

+38
-93
lines changed

17/umbraco-cms/.gitbook.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,5 @@ redirects:
148148
fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/date: fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/date-time-editor/README.md
149149
customizing/extending-overview/extension-types/workspaces/workspace-action-menu-item: customizing/extending-overview/extension-types/workspaces/workspace-action-menu-items.md
150150
customizing/extending-overview/extension-types/workspaces/workspace-footer-app: customizing/extending-overview/extension-types/workspaces/workspace-footer-apps.md
151+
customizing/extending-overview/extension-kind: customizing/extending-overview/extension-types/kind.md
151152

17/umbraco-cms/SUMMARY.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@
160160
* [Vite Package Setup](customizing/development-flow/vite-package-setup.md)
161161
* [Extensions Overview](customizing/extending-overview/README.md)
162162
* [Extension Registry](customizing/extending-overview/extension-registry/README.md)
163+
* [Extension Manifest Introduction](customizing/extending-overview/extension-registry/extension-manifest.md)
163164
* [Register an Extension](customizing/extending-overview/extension-registry/register-extensions.md)
164-
* [Extension Manifest](customizing/extending-overview/extension-registry/extension-manifest.md)
165-
* [Replace, Exclude or Unregister](customizing/extending-overview/extension-registry/replace-exclude-or-unregister.md)
165+
* [Replace, Exclude, or Unregister](customizing/extending-overview/extension-registry/replace-exclude-or-unregister.md)
166166
* [Extension Types](customizing/extending-overview/extension-types/README.md)
167167
* [App Entry Point](customizing/extending-overview/extension-types/app-entry-point.md)
168168
* [Backoffice Entry Point](customizing/extending-overview/extension-types/backoffice-entry-point.md)
@@ -197,7 +197,6 @@
197197
* [Workspace Views](customizing/extending-overview/extension-types/workspaces/workspace-views.md)
198198
* [Collections](customizing/extending-overview/extension-types/collections/README.md)
199199
* [Collection View](customizing/extending-overview/extension-types/collections/collection-view.md)
200-
* [Extension Kind](customizing/extending-overview/extension-kind.md)
201200
* [Extension Conditions](customizing/extending-overview/extension-conditions.md)
202201
* [Custom Extension types](customizing/extending-overview/custom-extension-type.md)
203202
* [Foundation](customizing/foundation/README.md)

17/umbraco-cms/customizing/extending-overview/extension-kind.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

17/umbraco-cms/customizing/extending-overview/extension-registry/README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,23 @@ description: >-
44
---
55

66
# Extension Registry
7-
The Umbraco backoffice is built with extensibility in mind. The backoffice without extensions is more or less a blank canvas that is build out using extensions. These extensions dictate how the backoffice functions and looks. All visual elements in an Umbraco installation, like the sections, menus, trees and buttons, are extensions. But extensions also dictate behaviour and the editing experience. So everything in the backoffice is governed (and extendable) by extensions.
7+
8+
The Umbraco backoffice is built with extensibility in mind. The backoffice without extensions is more or less a blank canvas that is built out using extensions. These extensions dictate how the backoffice functions and looks. All visual elements in an Umbraco installation, like the sections, menus, trees, and buttons, are extensions. But extensions also dictate behavior and the editing experience. So everything in the backoffice is governed (and extendable) by extensions.
89

910
{% hint style="info" %}
1011
You can see which extensions are registered in the backoffice by going to Settings > Extensions Insights.
1112
{% endhint %}
1213

13-
All extensions are registered in the extension registry. The registry can be manipulated at any time, meaning you can add or remove extensions at runtime. You as a developer have the same possibilities as an Umbraco HQ developer, which means what HQ can do, you can do. This also means that you can change almost everything that is by default present in Umbraco.
14+
All extensions are registered in the extension registry. The registry can be manipulated at any time, meaning you can add or remove extensions at runtime. You, as a developer, have the same possibilities as an Umbraco HQ developer, which means that what HQ can do, you can do. This also means that you can change almost everything that is by default present in Umbraco.
15+
16+
## [Introduction to Extension Manifest](extension-manifest.md)
1417

15-
## [Introduction to a Extension Manifest](extension-manifest.md)
16-
An Extension Manifest is a declaration of what you want to register in the Umbraco backoffice. This articles handles the layout and requirements of an Extension Manifest.
18+
An Extension Manifest is a declaration of what you want to register in the Umbraco backoffice. This article handles the layout and requirements of an Extension Manifest.
1719

18-
## [Register an extension](extension-registry.md)
19-
This article handles how to register an extension using an umbraco-package.json file.
20+
## [Register an Extension](extension-registry.md)
21+
22+
This article handles how to register an extension using an `umbraco-package.json` file.
2023

2124
## [Change an existing extension](replace-exclude-or-unregister.md)
25+
2226
Once you understand how to declare your own, you may want to replace or remove existing ones.

17/umbraco-cms/customizing/extending-overview/extension-registry/extension-manifest.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,24 @@ description: Learn about the different methods for declaring an Extension Manife
33
---
44

55
# Extension Manifest
6+
67
This page explains what an Extension Manifest for a Umbraco backoffice extension is. It outlines the manifest structure, required fields, and optional features used across types.
78

89
## What is an Extension Manifest?
10+
911
Umbraco reads the extension manifest to register the extension in the Extension Registry.
1012
Each extension is of a certain type and this determines the required fields of the manifest and its available capabilities.
1113
An Extension Manifest declares a single backoffice extension along with its configuration.
1214

1315
## Extension Manifest Format
16+
1417
Some extensions need extra assets, such as a JavaScript file with a Web Component.
1518

1619
The abilities of the extensions rely on the specific extension type. The type sets the scene for what the extension can do and what it needs to be utilized. Some extension types can be made purely via the manifest, like a section or menu item. Other types require files, like a JavaScript file containing a Web Component, like a custom property editor.
1720
An Extension Manifest has a strict format where some properties are required and some depend on the Extension Type. An Extension Manifest can be written as a JavaScript or JSON object. You can learn more about this when [registering an extension](register-extensions.md).
18-
### Required Manifest properties
21+
22+
### Required Manifest Properties
23+
1924
A minimal Extension Manifest looks like this:
2025

2126
```json
@@ -32,12 +37,13 @@ These fields are all required and have the following meaning:
3237
* `alias` — Unique identifier for this manifest. Prefix it with something that makes your extension unique. For example: _FictiveCompany.MyProject.Dashboard.Overview_.
3338
* `name` — Representational name of this manifest. This name does not need to be unique, but this can be beneficial when debugging extensions. This name also shows up in the Extensions Insights in the backoffice of Umbraco. For example: _My Fictive Company Overview Dashboard_.
3439

35-
### Additional Manifest properties
40+
### Additional Manifest Properties
41+
3642
Most extension types support the use of the following generic features for their Manifest:
3743

3844
* `weight` - Define a weight to determine the importance or visual order of this extension. A higher weight gives a more prominent position. For instance, for a dashboard it determines its order between other dashboards.
3945
* `overwrites` - If you want to omit an existing extension, then define one or more Extension Aliases that this extension should omit when presented. Read more in [Replace, Exclude or Unregister extensions](replace-exclude-or-unregister.md).
40-
* `conditions` - Define one or more conditions that must pass for the extension to become available. For instance, don't show a section if you don't have the proper rights. Read more in [Extension Conditions](../extension-conditions.md).
46+
* `conditions` - Define one or more conditions that must pass for the extension to become available. For instance, don't show a section if you don't have the proper rights. Read more in [Extension Conditions](../extension-conditions.md).
4147
* `kind` - Some extension types can reference a predefined `kind`. By specifying a `kind`, the manifest inherits the `kind`'s properties. This allows for reuse of predefined settings. See [Extension Kind](../extension-kind.md).
4248
* `meta` - Many Extension Types require additional information declared as part of a `meta` field. It depends on the Extension Type what is required. For instance label and icon of a menu item.
4349

17/umbraco-cms/customizing/extending-overview/extension-registry/register-extensions.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ description: >-
55
---
66

77

8-
# Register Extensions
8+
# Register an Extension
9+
910
Making extensions to either an Umbraco project or a package requires an umbraco-package.json file. This JSON file is the starting point for any extension.
1011

1112
## Umbraco-package.json
13+
1214
To get extensions registered in Umbraco, you need to have an `umbraco-package.json` file. This file must be located in or in a subfolder of either the `App_Plugins` folder or the `wwwroot` folder. It's recommended to place the file in `App_Plugins/#YOUR_EXTENSION_NAME#/umbraco-package.json`, or in `wwwroot/App_Plugins/#YOUR_EXTENSION_NAME#/umbraco-package.json` for packages and Razor Class Libraries. Umbraco scans for these files on boot and reads the [`Extension Manifests`](extension-manifest.md) that are present in the file to register the extensions.
1315

1416
{% hint style="info" %}
@@ -32,7 +34,6 @@ Extensions can also work outside of the context of a package.
3234
```
3335
{% endcode %}
3436

35-
3637
When writing the Umbraco Package Manifest, you can use the JSON schema located in the root of your Umbraco project. This file is called `umbraco-package-schema.json`.
3738

3839
{% code title="umbraco-package.json" %}
@@ -47,13 +48,11 @@ When writing the Umbraco Package Manifest, you can use the JSON schema located i
4748
```
4849
{% endcode %}
4950

50-
5151
There are two additional, optional properties that can be useful:
5252

5353
* `id` - a unique identifier of the package. If you are creating a NuGet package, use this value as the id.
5454
* `version` - the version of the package that is displayed in the backoffice in the overview of installed packages. This is also used for package migrations.
5555

56-
5756
This is an example of a full `umbraco-package.json` that registers two localization extensions:
5857

5958
```json
@@ -85,22 +84,24 @@ This is an example of a full `umbraco-package.json` that registers two localizat
8584
}
8685
```
8786

88-
8987
## Advanced Registration
88+
9089
### The Bundle Approach
90+
9191
Instead of registering each manifest in the `umbraco-package.json`, you can have multiple manifests and build them into a bundle. You then register this bundle in a single `bundle` extension. In larger projects with a lot of extensions, this allows you to keep your `umbraco-package.json` file cleaner. Read more in the [bundle approach](../extension-types/bundle.md).
9292

9393
### The Entry Point Approach
94+
9495
The Entry Point is an extension that executes a method on startup. You can use this for different tasks, such as performing initial configuration and registering other Extension Manifests. Read more in [the entry point approach](../extension-types/backoffice-entry-point.md).
9596

96-
### Registration with JavaScript on the Fly
97-
In some cases, extensions are not static and cannot be registered in the umbraco-package.json or in a bundle. Here are some examples of these cases:
97+
### Registration with JavaScript
9898

99-
- your manifest might be defined based on information from the server
100-
- you might generate the manifests server side based on data in the database.
99+
In some cases, extensions are not static and cannot be registered in the `umbraco-package.json` or in a bundle. Here are some examples of these cases:
101100

102-
In cases such as these, you need to register extensions on the fly.
101+
* Manifest might be defined based on information from the server.
102+
* Might generate the manifests server side based on data in the database.
103103

104+
In cases such as these, you need to register extensions.
104105

105106
The following example shows how to register an Extension Manifest via JavaScript/TypeScript code:
106107

@@ -116,5 +117,4 @@ const manifest = {
116117
umbExtensionsRegistry.register(manifest);
117118
```
118119

119-
120120
When and where you execute this code depends on your situation. In many cases, it makes sense to execute this on boot, using the [entry point approach](../extension-types/backoffice-entry-point.md).

17/umbraco-cms/customizing/extending-overview/extension-registry/replace-exclude-or-unregister.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,15 @@ description: >-
55
---
66

77

8-
# Replace, Exclude or Unregister
9-
Besides adding extensions to Umbraco, sometimes you want to change what is already there. You can replace extensions with your own and exclude or unregister extensions.
8+
# Replace, Exclude, or Unregister
109

10+
Besides adding extensions to Umbraco, sometimes you want to change what is already there. You can replace extensions with your own and exclude or unregister extensions.
1111

1212
## Replace
13+
1314
You can replace an existing extension by another one.
1415
You can do this by defining the `overwrites` property in your [Extension Manifest](extension-manifest.md) with one Extension Alias. For multiple `overwrites` you can provide the Extension Aliases that need to be replaced as an array.
1516

16-
17-
18-
1917
This example overrides the `save and preview` button with an external "preview" button (single overwrite):
2018

2119
```typescript
@@ -28,7 +26,6 @@ const manifest = {
2826
};
2927
```
3028

31-
3229
This example overrides both the `save and preview` button as well as the `save` button with an external "preview" button (multiple overwrite):
3330

3431
```typescript
@@ -41,19 +38,16 @@ const manifest = {
4138
};
4239
```
4340

44-
4541
If your extension has conditions, the overwritten extensions will only be hidden when your extension is displayed. This means that the overwrites only have an effect if all the conditions are permitted and the extensions are displayed at the same spot.
4642

47-
4843
## Exclude
49-
When you exclude an extension, the extension will never be displayed. This allows you to permanently hide, for example, a menu or a button. This does not unregister the extension, but rather flags it as excluded. This also means that no one else can register an extension with the same alias as the excluded extension.
5044

45+
When you exclude an extension, the extension will never be displayed. This allows you to permanently hide, for example, a menu or a button. This does not unregister the extension, but rather flags it as excluded. This also means that no one else can register an extension with the same alias as the excluded extension.
5146

5247
{% hint style="warning" %}
5348
Currently, it is not possible to un-exclude extensions once excluded.
5449
{% endhint %}
5550

56-
5751
The following JavaScript code hides the `Save and Preview` button from the Document Workspace.
5852

5953
```typescript
@@ -64,8 +58,8 @@ UmbExtensionRegistry.exclude('Umb.WorkspaceAction.Document.SaveAndPreview');
6458

6559
When and where you execute this code depends on your situation. In many cases, it makes sense to execute this on boot, using the [entry point approach](../extension-types/backoffice-entry-point.md).
6660

67-
6861
## Unregister
62+
6963
You can also choose to unregister an extension. You should only use this on extensions you registered yourself and have control over. Otherwise, you might try to remove an extension before it is registered. A use case for this, is if you temporarily registered an extension and you want to remove it again.
7064

7165
In other cases, you can use the `overwrites` or `exclude` option. The difference with the `exclude` approach is that unregistering removes the extension from the Extension Registry. This allows you to re-register extensions with the same alias.
@@ -76,7 +70,4 @@ import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registr
7670
umbExtensionsRegistry.unregister('My.WorkspaceAction.AutoFillWithUnicorns');
7771
```
7872

79-
8073
When and where you execute this code depends on your situation. In many cases, it makes sense to execute this on boot, using the [entry point approach](../extension-types/backoffice-entry-point.md).
81-
82-

0 commit comments

Comments
 (0)