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
Copy file name to clipboardExpand all lines: 16/umbraco-cms/customizing/extending-overview/extension-registry/README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,23 @@ description: >-
4
4
---
5
5
6
6
# Extension Registry
7
+
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.
8
9
9
10
{% hint style="info" %}
10
11
You can see which extensions are registered in the backoffice by going to Settings > Extensions Insights.
11
12
{% endhint %}
12
13
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 that 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.
14
15
15
16
## [Introduction to Extension Manifest](extension-manifest.md)
17
+
16
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.
17
19
18
20
## [Register an Extension](extension-registry.md)
21
+
19
22
This article handles how to register an extension using an `umbraco-package.json` file.
20
23
21
24
## [Change an existing extension](replace-exclude-or-unregister.md)
25
+
22
26
Once you understand how to declare your own, you may want to replace or remove existing ones.
Copy file name to clipboardExpand all lines: 16/umbraco-cms/customizing/extending-overview/extension-registry/extension-manifest.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,19 +3,24 @@ description: Learn about the different methods for declaring an Extension Manife
3
3
---
4
4
5
5
# Extension Manifest
6
+
6
7
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.
7
8
8
9
## What is an Extension Manifest?
10
+
9
11
Umbraco reads the extension manifest to register the extension in the Extension Registry.
10
12
Each extension is of a certain type and this determines the required fields of the manifest and its available capabilities.
11
13
An Extension Manifest declares a single backoffice extension along with its configuration.
12
14
13
15
## Extension Manifest Format
16
+
14
17
Some extensions need extra assets, such as a JavaScript file with a Web Component.
15
18
16
19
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.
17
20
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
+
19
24
A minimal Extension Manifest looks like this:
20
25
21
26
```json
@@ -32,12 +37,13 @@ These fields are all required and have the following meaning:
32
37
*`alias` — Unique identifier for this manifest. Prefix it with something that makes your extension unique. For example: _FictiveCompany.MyProject.Dashboard.Overview_.
33
38
*`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_.
34
39
35
-
### Additional Manifest properties
40
+
### Additional Manifest Properties
41
+
36
42
Most extension types support the use of the following generic features for their Manifest:
37
43
38
44
*`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.
39
45
*`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).
41
47
*`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).
42
48
*`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.
Copy file name to clipboardExpand all lines: 16/umbraco-cms/customizing/extending-overview/extension-registry/register-extensions.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,12 @@ description: >-
5
5
---
6
6
7
7
8
-
# Register Extensions
8
+
# Register an Extension
9
+
9
10
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.
10
11
11
12
## Umbraco-package.json
13
+
12
14
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.
13
15
14
16
{% hint style="info" %}
@@ -32,7 +34,6 @@ Extensions can also work outside of the context of a package.
32
34
```
33
35
{% endcode %}
34
36
35
-
36
37
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`.
37
38
38
39
{% code title="umbraco-package.json" %}
@@ -47,13 +48,11 @@ When writing the Umbraco Package Manifest, you can use the JSON schema located i
47
48
```
48
49
{% endcode %}
49
50
50
-
51
51
There are two additional, optional properties that can be useful:
52
52
53
53
*`id` - a unique identifier of the package. If you are creating a NuGet package, use this value as the id.
54
54
*`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.
55
55
56
-
57
56
This is an example of a full `umbraco-package.json` that registers two localization extensions:
58
57
59
58
```json
@@ -85,22 +84,24 @@ This is an example of a full `umbraco-package.json` that registers two localizat
85
84
}
86
85
```
87
86
88
-
89
87
## Advanced Registration
88
+
90
89
### The Bundle Approach
90
+
91
91
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).
92
92
93
93
### The Entry Point Approach
94
+
94
95
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).
95
96
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
98
98
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:
101
100
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.
103
103
104
+
In cases such as these, you need to register extensions.
104
105
105
106
The following example shows how to register an Extension Manifest via JavaScript/TypeScript code:
106
107
@@ -116,5 +117,4 @@ const manifest = {
116
117
umbExtensionsRegistry.register(manifest);
117
118
```
118
119
119
-
120
120
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).
Copy file name to clipboardExpand all lines: 16/umbraco-cms/customizing/extending-overview/extension-registry/replace-exclude-or-unregister.md
+5-14Lines changed: 5 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,15 @@ description: >-
5
5
---
6
6
7
7
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
10
9
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.
11
11
12
12
## Replace
13
+
13
14
You can replace an existing extension by another one.
14
15
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.
15
16
16
-
17
-
18
-
19
17
This example overrides the `save and preview` button with an external "preview" button (single overwrite):
20
18
21
19
```typescript
@@ -28,7 +26,6 @@ const manifest = {
28
26
};
29
27
```
30
28
31
-
32
29
This example overrides both the `save and preview` button as well as the `save` button with an external "preview" button (multiple overwrite):
33
30
34
31
```typescript
@@ -41,19 +38,16 @@ const manifest = {
41
38
};
42
39
```
43
40
44
-
45
41
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.
46
42
47
-
48
43
## 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.
50
44
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.
51
46
52
47
{% hint style="warning" %}
53
48
Currently, it is not possible to un-exclude extensions once excluded.
54
49
{% endhint %}
55
50
56
-
57
51
The following JavaScript code hides the `Save and Preview` button from the Document Workspace.
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).
66
60
67
-
68
61
## Unregister
62
+
69
63
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.
70
64
71
65
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
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).
0 commit comments