Loading...
Loading...
Loading...
Loading...
The declaration of an extension is done by an Extension Manifest, either registered via an Umbraco-Package Manifest or directly to the Extension Registry in JavaScript.
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
The extension registry is the center piece of the Backoffice UI. It holds information about most of the Backoffice UI, as most are extensions. This includes the built-in UI. The registry can be manipulated at any time, meaning you can add or remove extensions at runtime.
To provide new UI to the backoffice, you must register them via an Extension Manifest. This can be initiated via an Umbraco Package JSON file on the server. This will be your starting point.
Declaring a new extension is done by declaring an extension manifest. This can be done in one of two ways:
Via a manifest JSON file on the server.
In a JavaScript/TypeScript file.
These two options can be combined as you like.
A typical use case of such is achieved by registering a single extension manifest in your Umbraco Package JSON file. This manifest would then load a JS file, that registers the rest of your extensions. Learn more about these abilities in the bundle or backoffice entry point articles.
Example how to work with extension registry
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
A header app appears next to the user profile and global search icon on the top-right corner of Umbraco's backoffice.
In this article, you can find an example of an extension registry. This example details the creation of a Header App in two ways, similar to how the extension registry can be created:
.
.
Below you can find an example of how to setup a Header App using the manifest file.
Create a manifest file named umbraco-package.json
at the root of the header-app
folder. Here we define and configure our dashboard.
Add the following code to umbraco-package.json
:
First we define the type which is a headerApp
. Then we add a unique alias and a name to define the extension UI.
Then we can define what kind of extension it is, where in this case we can use a pre-defined element called button.
The button requires some metdata: an icon, label of the button (name of the button) and a link which opens once clicked.
In the header-app
folder run npm run build
and then run the project. Then in the backoffice you will see our new Header App extension with heart icon:
Below you can find an example of how to setup a Header App using the TypeScript file.
This is a continuation of the above steps from the Button Header App with Manifest example. We will register a new Header App directly from the .ts file.
Add a reference to the .js file. Update the umbraco-package.json
with the following:
Replace the content of the src/my-element.ts file
with the following:
In the header-app
folder run npm run build
and then run the project. Then in the backoffice you will see our new Header App extension with address book icon:
Learn about the different methods for declaring an Extension Manifest.
The Extension Manifest is the point of entry for any extension. This is the declaration of what you want to register.
The content in this section describes all the extension types that the Backoffice supports. Find a list of the most common types in the article.
An Extension Manifest can be written either as a JavaScript Object or a JSON Object.
There are a few general properties, the required set of properties consists of the type
, alias
, and name
.
The type
defines what it is declaring The alias
is a unique identifier for this manifest. It must be globally unique, so make sure to prefix it with something that makes your extension unique. The name
is a representational name of this manifest, this does not need to be unique but such can be beneficial when debugging extensions.
Each Extension Manifest has to declare its type. This is used to determine where it hooks into the system. It also determines what data is required of this manifest.
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. Other requires files, like a JavaScript file containing a Web Component.
The required fields of any extension manifest are:
type
- The type defines the type and purpose of the extension. It is used to determine where the extension will be used and defines the data needed for this manifest.
alias
- The alias is used to identify the extension. This has to be unique for each extension.
name
- The name of the extension. This is used to identify the extension in the UI.
Additionally, many extensions support the use of the following fields:
weight
- Define a weight, to determine the importance or visual order of this extension.
Many of the Extension Types require additional information declared as part of a meta
field.
An Extension Manifest can be declared in multiple ways.
Additionally, two Extension types can be used to register other extensions.
bundle
extension typeThe Bundle extension type can be used for declaring multiple Extension Manifests with JavaScript in a single file.
The Bundle declares a single JavaScript file that will be loaded at startup. All the Extension Manifests exported of this Module will be registered in the Extension Registry.
backofficeEntryPoint
extension typeThe backofficeEntryPoint
extension type can run any JavaScript code at startup. This can be used as an entry point for a package.
The entry point declares a single JavaScript file that will be loaded and run when the Backoffice starts.
The entryPbackofficeEntryPointoint
extension is also the way to go if you want to load in external libraries such as jQuery, Angular, or React. You can use the backofficeEntryPoint
type to load in the external libraries to be shared by all your extensions. Loading global CSS files can also be used in the backofficeEntryPoint
extension.
Alternatively, an Extension Manifest can be declared in JavaScript at any given point.
The following example shows how to register an extension manifest via JavaScript code:
Follow the to create a header app and name it "header-app
" when using the guide.
conditions
- Define one or more conditions that must be permitted for the extension to become available. .
kind
- Define a kind-alias of which this manifest should be based upon. Kinds acts like a preset for your manifest. .
The primary way is to declare it as part of the .
A typical use case is to declare one main Extension Manifest as part of the . Such main Extension Manifest would be using one of the following types:
Read more about the bundle
extension type in the article.
Read more about the backofficeEntryPoint
extension type in the article.
Learn how to append and use Icons.
This article describes how to add and use more icons in your UI.
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
New icons can be added via an extension type called icons
.
You must add a new manifest to the Extension API to register icons. The manifest can be added through the umbraco-package.json
file as shown in the snippet below.
The file set in the js
field holds the details about your Icons. The file should resemble the following:
The icon name needs to be prefixed to avoid collision with other icons.
Each icon must define a path, either as a string or a dynamic import as shown above. This file must be a JavaScript file containing a default export of an SVG string. See an example of this in the code snippet below.
The umb-icon
element is automatically able to consume any registered icon.
The following example shows how to make a button using the above-registered icon.
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
Most of BackOffice is based on Extensions making it crucial to understand how to register your own extensions. This introduction will give you an outline of the abilities of the extension registry.
The extension registry is a global registry that can be accessed and changed at anytime while Backoffice is running.
Each Extension Manifest has to declare its type, this is used to determine where it hooks into the system. It also looks at what data is required to declare within it.
Most extension types support conditions. Defining conditions enables you to control when and where the extension is available.
The kinds feature enables you to base your extension registration on a preset. A kind provides the base manifest that you like to extend.
The Entry Point manifest type is used to register an entry point for the backoffice. An entry point is a single JavaScript file that is loaded when the backoffice is initialized. This file can be used to do anything, this enables more complex logic to take place on startup.
The bundle
extension type enables you to gather many extension manifests into one.
New modals can be added to the system via the extension registry. This article goes through how this is done.
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
There are two parts to creating a custom modal:
First, you need to create a modal element which you need to register in the extension registry.
Second, you need to create and export a modal token.
A modal token is a string that identifies a modal. This is the modal extension alias. It is used to open a modal and is also to set default options for the modal. It should also have a unique alias to avoid conflicts with other modals.
A modal token is a generic type that takes two type arguments. The first is the type of the data that is passed to the modal when it is opened. The second is the type of the value that is returned when the modal is closed.
A modal element is a web component that is used to render the modal. It should implement the UmbModalExtensionElement
interface. The modal context is injected into the element when the modal is opened in the modalContext
property. The modal context is used to close the modal, update the value and submit the modal.
Additionally, the modal element can see its data parameters through the modalContext
property. In this example, the modal data is of type MyModalData
and the modal value is of type MyModalValue
. The modal context is of type UmbModalContext<MyModalData, MyModalValue>
. We are using the data to render a headline and the value to update the value and submit the modal.
The modal element needs to be registered in the extension registry. This is done by defining the modal in the manifest file. The element
property should point to the file that contains the modal element.
To open the modal, you need to consume the UmbModalManagerContext
and then use the modal manager context to open a modal. This example shows how to consume the Modal Manager Context:
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
You can register modals with a route, making it possible to link directly to that specific modal. This also means the user can navigate back and forth in the browser history.
A modal can be registered via the UmbModalRouteRegistrationController
. The registration accepts a modal token (or extension alias).
The registration holds an instance of its UmbModalHandler
when the modal is active. The modal registration accepts 4 different callbacks:
onSetup
- called when the modal is opened
onSubmit
- called when the modal is submitted
onReject
- called when the modal is rejected
observeRouteBuilder
- called when the modal route changes. Use the given route builder to build a route to open the modal
Additional features of the route Registration:
Adds unique parts to the path.
A modal registered in a dashboard can be setup in few steps
A modal registered in a property editor needs to become specific for the property and the variant of that property.
Builds some data for the setup.
Rejects a modal by returning false in setup.
Uses a parameter as part of the setup to determine the data going to the modal.
When configuring a routed modal from a Property Editor, it's important to be aware of some facts. Those facts are that the Property Editor shares the same URL path as other Property Editors. This means we need to ensure the registration is unique so it doesn't collide with other Property Editors. To do so we will make use of the Property Alias and the Variant ID.
Generate the URL to a Modal Route Registration
The Modal registration has an option to retrieve a URL Builder. This is a function that can be used to generate a URL to a modal:
The modalLink
from above could look like this: /umbraco/backoffice/my/location/modal/Our.Modal.SomethingPicker/my-input-alias
Notice the Property Editor registration will add the property alias and variant ID to the URL, so it becomes:
/umbraco/backoffice/my/location/modal/Our.Modal.SomethingPicker/my-property-alias/en-us/my-input-alias
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
In this section, you can learn how to register and create a custom Menu for the Umbraco backoffice.
The manifest file can be created using either JSON or TypeScript. Both methods are shown below.
We can create the manifest using JSON in the umbraco-package.json
.
The manifest can also be written in TypeScript.
For this TypeScript example we used a Backoffice Entry Point extension to register the manifests.
Menu items are the items that appear in the menu.
In this section, you can learn how to add custom Menu Items to your Umbraco backoffice Menu.
To add custom menu items, you can define a single MenuItem manifest and link an element to it. In this element, you can fetch the data and render as many menu items as you want based on that data.
The code snippets below show how to declare a new menu item using JSON or TypeScript.
We can create the manifest using JSON in the umbraco-package.json
.
The manifest can also be written in TypeScript.
For this TypeScript example we used a Backoffice Entry Point extension to register the manifests.
Rendering menu items with Umbraco's UI menu item component
To render your menu items in Umbraco, you can use the Umbraco UI Menu Item component. This component allows you to create nested menu structures with a few lines of code.
By default, you can set the has-children
attribute to display the caret icon indicating nested items. It will look like this: ?has-children=${bool}
.
Example:
Custom menu item element example
You can fetch the data and render the menu items using the Lit element above. By putting the result of the fetch in a @state()
, we can trigger a re-render of the component when the data is fetched.
Default Element
The backoffice comes with a couple of menus.
Content, Media, Settings, Templating, Dictionary, etc.
To add a menu item to an existing menu, you can use the meta.menus
property.
Getting started with backoffice setup and configurations
The Backoffice architecture is based on Extensions, making different UI parts extendable. Enabling you to append, replace, or remove parts.
You are not limited to any specific tech stack. UI Elements are based on Web Components and the Backoffice APIs are based on native code.
In this section you can find the common terms, concepts and guides used to extend the Umbraco backoffice.
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
An overview of concepts on how to work with extension registration when extending the backoffice.
An overview of concepts on how to work with extension types when extending the backoffice.
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
The bundle
extension type enables you to gather many extension manifests into one.
It points to a single JavaScript file that via JavaScript Modules, exports or re-exports Extension Manifests written in JavaScript.
It can be used as the entry point for a package, or as a grouping for a set of manifests.
If you want to declare your manifests in JavaScript/TypeScript, the Bundle is a great choice.
The following example shows an umbraco-package.json
that refers to one bundle, which can then declare manifests.
A kind extension provides the preset for other extensions to use
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
A kind is matched with a specific type. When another extension uses that type and kind it will inherit the preset manifest of the kind extension.
The registration of Kinds is done in the same manner as the registration of other extensions. But the format of it is different. Let's take a look at an example of how to implement the Kind registration
for a Button Kind.
The root properties of this object define the Kind registration
. Then the manifest property holds the preset for the extension using this kind to be based upon. This object can hold the property values that make sense for the Kind.
For the kind to be used, it needs to match up with the registration of the extension using it. This happens when the extension uses a type, which matches the value of matchType
of the Kind. As well the extension has to utilize that kind, by setting the value of kind
to the value of matchKind
the Kind.
In the following example, a kind is registered. This kind provides a default element for extensions utilizing this kind.
This enables other extensions to use this kind and inherit the manifest properties defined in the kind.
In this example a Header App is registered without defining an element, this is possible because the registration inherits the elementName from the kind.
Ask the user for confirmation
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
This example shows how to open a confirm dialog. The UMB_CONFIRM_MODAL
is a token that represents the confirm dialog. The open
method takes the token and an object with the data for the confirm dialog. The onSubmit
method returns a promise that resolves when the user confirms the dialog and rejects when the user cancels the dialog.
The confirm modal itself is built-in and does not need to be registered in the extension registry.
The modal token describes the options that you can pass to the modal. The confirm modal token has the following properties:
headline
- The headline of the modal.
content
- The content of the modal, which can be a TemplateResult or a string.
color
- (Optional) The color of the modal. This can be positive
or danger
.
confirmLabel
- (Optional) The label of the confirm button.
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
Entity Bulk Action: Relates to an entity type: document, media, etc. Performs the action on a selection of items.
As part of the Extension Manifest you can attach a class that will be instantiated as part of the action. It will have access to the host element, a repository with the given alias and the unique (key etc) of the entity. When the action is clicked the execute
method on the api class will be run. When the action is completed, an event on the host element will be dispatched to notify any surrounding elements.
Entity Actions perform an action on a specific item
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
Entity Actions was previously called Tree Actions.
Entity Actions is a feature that provides a generic place for secondary or additional functionality for an entity type. An entity type can be a media, document and so on.
Items in an Umbraco Tree can have associated Actions. The actions visible to the currently logged in user can be controlled via User Permissions.
You can set a User's permissions for each item in the Umbraco Content tree from the User Section of the Umbraco Backoffice.
If you are developing a custom section or a custom Dashboard, you might want to display some different options. This depends on a User's permission set on a particular item.
Sidebar Context Menu is an entity action that can be performed on a menu item. For example in the content section you can perform some extra actions on the content such as sorting, moving, etc.
Default Element
As part of the Extension Manifest you can attach a class that will be instanciated as part of the action. It will have access to the host element, a repository with the given alias and the unique (key etc) of the entity.
The class either provides a getHref method, or an execute method. If the getHref method is provided, the action will use the link. Otherwise the execute
method will be used. When the action is clicked the execute
method on the api class will be run. When the action is completed, an event on the host element will be dispatched to notify any surrounding elements.
Example of providing a getHref
method:
Example of providing a execute
method:
If any additional contexts are needed, these can be consumed from the host element:
We currently have a couple of generic actions that can be used across silos, so we don't have to write the same logic again. These actions include copy, move, trash, delete, etc. We can add more as we discover the needs.
Here is a list of the entity actions and associated user permission codes shipped by Umbraco CMS and add-on projects, such as Umbraco Deploy. This list also includes codes used by some community packages.
If you are building a package or adding custom entity actions to your solution, it's important to pick a permission letter. Ensure that it doesn't clash with one of these.
Currently, we allow two extension points on the client for user permissions:
Entity User Permissions - Relates to an entity (example document).
Granular User Permission - Relates to a $type server schemaType.
Each permission comes with a set of verbs, that will be checked against client and server-side.
The Core currently ships with entity user permission for documents. The permissions are as follows:
Entity User Permissions will be registered in the extension registry with a manifest with the following type. Example:
Granular permissions will also be registered. It is possible to provide a custom element to build the needed UX for that type of permission:
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
The backofficeEntryPoint
extension type can be used to run some JavaScript code at startup.
The entry point declares a single JavaScript file that will be loaded and run when the Backoffice starts. In other words this can be used as an entry point for a package.
The backofficeEntryPoint
extension is also the way to go if you want to load in external libraries such as jQuery, Angular, React, etc. You can use the backofficeEntryPoint
to load in the external libraries to be shared by all your extensions. Additionally, global CSS files can also be used in the backofficeEntryPoint
extension.
The Entry Point manifest type is used to register an entry point for the backoffice. An entry point is a single JavaScript file that is loaded when the backoffice is initialized. This file can be used to do anything, this enables more complex logic to take place on startup.
Register an entry point in the umbraco-package.json
manifest
Register additional UI extensions in the entry point file
A guide to creating custom dashboards in Umbraco
Each section of the Umbraco backoffice has its own set of default dashboards. Your own custom sections can show dashboards, and you can create your own custom dashboards for existing sections.
The dashboard area of Umbraco is used to display an "editor" for the selected item in the tree. If no item is selected, then the default set of section dashboards is shown in the dashboard area.
Notice that is another similar approach to append information to the root of a Section. Section views are thought mainly to be used as Secondary pages. These two approaches should ideally not be combined.
The default dashboards in Umbraco are the ones that are displayed when you first enter a section in the backoffice. These dashboards are used to display information and functionality that is relevant to the section you are in.
The default sections in Umbraco are:
Here is a table of the default dashboards in Umbraco and the sections they are used including their aliases:
Even though these dashboards are useful, you might want to create your own custom dashboard to display specific information or functionality.
This section dives into the Dashboard Extension Manifest, shows how to register one, and append additional details.
Insert this as an entry in the extensions
list in a umbraco-package.json
file.
This will register a dashboard with the alias my.welcome.dashboard
and the name My Welcome Dashboard
. The dashboard will be loaded from the file /App_Plugins/WelcomeDashboard/dashboard.js
. The dashboard will be displayed with the label Welcome Dashboard
and the URL /welcome-dashboard
on all sections, e.g. /section/content/dashboard/welcome-dashboard
.
This will make the dashboard only be displayed on the Content section.
The dashboard manifest can contain the following properties:
Learn how to declare requirements for your extensions using the Extension Conditions.
Extension Conditions declare requirements that should be permitted for the extension to be available. Many, but not all, Extension Types support Conditions.
.
The following conditions are available out of the box, for all extension types that support Conditions.
Umb.Condition.SectionAlias
- Requires the current Section Alias to match the one specified.
Umb.Condition.MenuAlias
- Requires the current Menu Alias to match the one specified.
Umb.Condition.WorkspaceAlias
- Requires the current Workspace Alias to match the one specified.
Umb.Condition.WorkspaceEntityType
- Requires the current workspace to work on the given Entity Type. Examples: 'document', 'block' or 'user'.
Umb.Condition.WorkspaceContentTypeAlias
- Requires the current workspace to be based on a Content Type which Alias matches the one specified.
Umb.Condition.Workspace.ContentHasProperties
- Requires the Content Type of the current Workspace to have properties.
Umb.Condition.WorkspaceHasCollection
- Requires the current Workspace to have a Collection.
Umb.Condition.WorkspaceEntityIsNew
- Requires the current Workspace data to be new, not yet persisted on the server.
Umb.Condition.EntityIsTrashed
- Requires the current entity to be trashed.
Umb.Condition.EntityIsNotTrashed
- Requires the current entity to not be trashed.
Umb.Condition.SectionUserPermission
- Requires the current user to have permissions to the given Section Alias.
Umb.Condition.UserPermission.Document
- Requires the current user to have specific Document permissions. Example: 'Umb.Document.Save'
You can make your own Conditions by creating a class that implements the UmbExtensionCondition
interface.
This has to be registered in the extension registry, shown below:
Finally, you can make use of the condition in your configuration. See an example of this below:
As can be seen in the code above, we never make use of match
. We can do this by replacing the timeout with some other check.
With all that in place, the configuration can look like shown below:
A modal is a popup layer that darkens the surroundings and comes with a focus lock. There are two types of modals: "dialog" and "sidebar".
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
The Dialog modal appears in the middle of the screen. and the Sidebar Modal slide in from the right.
For type safety, we recommend that you use Modal Tokens. The Modal Token binds the Modal Type with a Modal Data Type and a Modal Result Type.
This can also come with defaults, for example, settings for the modal type and size.
This is an example of a Modal Token declaration:
Consume the UMB_MODAL_MANAGER_CONTEXT
and then use the modal manager context to open a modal. This example shows how to consume the Modal Manager Context:
A modal can be opened in two ways. Either you register the modal with a route or at runtime open the modal. The initial option allows users to deep-link to the modal, a potential preference in certain cases; otherwise, consider the latter.
In this case, we use the Modal Token from above, this takes a key as its data. And if submitted then it returns the new key.
Modal Route Registration
You can register modals with a route, making it possible to link directly to that specific modal. This also means the user can navigate back and forth in the browser history. This makes it an ideal solution for modals containing an editorial experience.
If you have created a package using a custom entity action, please consider providing an update to this documentation page. You can do this via a PR to the . This will allow other developers to discover and avoid using the same permission letter.
Current Backoffice Letter | Verb |
---|
Alias | Name |
---|
Alias | Section | Weight | Description |
---|
You can try and as a way on getting started on this topic.
You can read more about manifests in the tutorial .
You can specify conditions for when the dashboard should be displayed. This is done by adding a conditions
property to the manifest. Ideally, we would like the dashboard to be shown only in a specific section. This can be done by specifying the condition called Umb.Condition.SectionAlias
and providing the you want the dashboard to be displayed on:
You can read more about in the documentation.
Property | Type | Description |
---|
You can learn about in the tutorials section. Here you will learn how to build the dashboard itself as a Web Component.
To create your own modal, read the before proceeding with this article.
For a more concrete example, check out the .
C | Umb.Document.Create |
F | Umb.Document.Read |
A | Umb.Document.Update |
D | Umb.Document.Delete |
I | Umb.Document.CreateBlueprint |
N | Umb.Document.Notifications |
U | Umb.Document.Publish |
R | Umb.Document.Permissions |
Z | Umb.Document.Unpublish |
O | Umb.Document.Duplicate |
M | Umb.Document.Move |
S | Umb.Document.Sort |
I | Umb.Document.CultureAndHostnames |
P | Umb.Document.PublicAccess |
K | Umb.Document.Rollback |
V | Umb.DocumentRecycleBin.Restore |
Umb.Section.Content | Content |
Umb.Section.Media | Media |
Umb.Section.Settings | Settings |
Umb.Section.Members | Members |
Umb.Section.Users | Users |
Umb.Section.Translation | Dictionary |
Umb.Dashboard.UmbracoNews | Umb.Section.Content | 20 | The Getting Started dashboard users see when they first enter Umbraco. Contains the latest news of Umbraco including outbound links to resources |
Umb.Dashboard.RedirectManagement | Umb.Section.Content | 10 | Contains a list of active URL redirects |
Umb.Dashboard.SettingsWelcome | Umb.Section.Settings | 500 | Contains a set of boxes with links to appropriate resources |
Establish the bond for extensions to communication across the application
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
A global context manages the logic code from your Lit Element controllers.
You can register a global context like so:
A guide to creating a custom tree in Umbraco
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
The tree is a hierarchical structure of nodes and is registered in the Backoffice extension registry. A tree can be rendered anywhere in the Backoffice with the help of the umb-tree element.
To Create a Tree in a section of the Umbraco backoffice, you need to take multiple steps:
The backoffice comes with two different tree item kinds out of the box: entity and fileSystem.
Tree Manifest:
We provide a base class for the tree item context. This class provides some default implementations for the context. You can extend this class to overwrite any of the default implementations.
Learn how to manage and use the Backoffice UI Localization files.
When registering localizations to a language, you must add a new manifest to the Extension API. The manifest can be added through the umbraco-package.json
file. Usually, the localization keys are provided through a JavaScript module. In this example, we will use a file named en.js
:
Read more about extensions in the Package Manifest article.
The localization files for the UI are JavaScript modules with a default export containing a key-value structure organized in sections.
The sections and keys will be formatted into a map in Umbraco with the format section_key1
and section_key2.
These form the unique key they are requested.
If you do not have many translations, you can also choose to include them directly in the meta-object:
In this case, the en.js
file is not required and we can remove the "js" property from the manifest. Only strings can be used in the meta-object.
The extension registry is an open system, which can hold any Extension Manifest Type. This article describes how you can declare your types. Types can be declared for re-useability/maintainability or to open up for other package extensions.
A Manifest Type is declared via a TypeScript Interface, like shown below:
Establish an extension to communicate across the application.
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
A Workspace context is a container for the data of a workspace. It is a wrapper around the data of the entity that the workspace is working on. It is responsible for loading and saving the data to the server. Workspace Contexts are used to bring additional context alongside the default context of a workspace.
A workspace context knows about its entity type (for example content, media, member, etc.) and holds its unique string (for example: key).
Most workspace contexts hold a draft state of its entity data. It is a copy of the entity data that can be modified at runtime and sent to the server to be saved.
If a workspace wants to utilize Property Editor UIs, then it must provide a variant context for the property editors. The variant-context is the generic interface between workspace and property editors.
The API will be initiated with the same host as the default Workspace Context.
The code of such an API file could look like this:
Context APIs have to be self-providing. To do so it has to be an Umbraco Controller.
A Context Token for a Workspace Context Extension should look like this:
We recommend using UmbWorkspaceContext
as the Context Alias for your Context Token. This will ensure that the requester only retrieves this Context if it's present at their nearest Workspace Context. Use the Extension Manifest Alias as the API Alias for your Context Token. For more information, see the Context API article.
type | string | The type of extension, should be |
alias | string | A unique alias for the dashboard extension |
name | string | The name of the dashboard extension |
element | string | The path to the JavaScript file that exports the dashboard |
elementName | string | (Optional) The name of the Web Component that contains the dashboard (only if not a default export) |
weight | number | (Optional) The weight of the dashboard, higher numbers are displayed first |
meta | object | Additional metadata for the dashboard |
Property | Type | Description |
Label | string | The label shown to the user |
pathname | string | The routable URL pathname |
Property | Type | Description |
Label | string | The label shown to the user |
pathname | string | The routable URL pathname |
Property | Type | Description |
Label | string | The label shown to the user |
pathname | string | The routable URL pathname |
conditions | array |
Learn how to use the Kind extension in your manifest files when extending the Umbraco CMS backoffice.
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
Extension Manifest Kind enables declarations to be based upon a preset Manifest.
This is used for maintainability or to inherit existing features.
A Kind is utilized by declaring it in the kind
field of a Manifest:
By declaring a kind, the Manifest will inherit fields of the defined Kind.
A typical use case is a Kind that provides an element, but requires additional meta fields, to fulfill the needs of its element.
In the following example, a manifest using the type 'headerApp' utilizes the 'button' kind. This brings an element and requires some additional information as part of the meta object.
Adding the metadata provides the ability to use and configure existing functionality to a specific need.
Learn more about Kinds and how to create your own:
Learn how to use Extension Conditions when working with the Umbraco backoffice.
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
Extension Manifest Conditions enable you to declare requirements for an Extension before it becomes available.
Conditions are referenced via their alias. The Declaration of a Condition is shown in the following example:
By declaring a condition the extension will become available only once the condition is permitted.
The example above requires the nearest Workspaces Alias to be equal to 'Umb.Workspace.Document'
.
When declaring multiple conditions all of them must be permitted for the extension to be available.
The conditions are defined as an array of condition configurations. Each entry can contain the following properties:
alias
- The alias of the condition to utilize.
...
- The rest of the properties of the object are specific to the condition configuration.
Learn about built-in conditions and how to create your own:
A guide to creating a section
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
The Umbraco backoffice consists of Sections. Section is the main division shown in the top navigation.
For example, when you load the backoffice, you'll see the 'Content' section, 'Settings' section, and so on.
You can create your own sections to extend Umbraco with room for more features.
When creating a new section it's recommended to use a Entry Point-extension in your Umbraco Package Manifest. This is to get better control over all the additional extensions required for the new section.
Create a section by defining a manifest for it:
Once registered, you will be able to select this action for your User Group Permissions. Once that is permitted, you can view your section.
Once a section is registered, it can be extended like any other section.
Here is a list of appropriate extensions to append to your section:
If you prefer full control over the content of your section you can choose to define an element for the content of your section.
This is not recommended as it limits the content of your section to this element. Instead, it is recommended to use a single Dashboard or Section View.
If you like to have full control, you can define an element like this:
The element file must have an element
or default
export, or specify the element name in the elementName
field.
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
Manifest
Default Element
Sidebar Menu:
The Backoffice comes with a menu sidebar app that can be used to create a menu in the sidebar.
To register a new menu sidebar app, add the following to your manifest
The menu sidebar app will reference a menu that you have registered in the menu with a menu manifest
Manifest
Default Element
Adding Items to an existing menu
This will make it possible to compose a sidebar menu from multiple Apps:
You can read more about this in the Menu article.
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
Workspace actions are a set of functionalities or operations that can be performed within a workspace. These actions involve creating documents within the workspace, organizing and categorizing documents, publishing content and so on.
Workspace action relates to a workspace alias (Umb.Workspace.Document) and has Access to the workspace context.
JavaScript Manifest example
As part of the Extension Manifest you can attach a class that will be instantiated as part of the action. It will have access to the host element and the Workspace Context. When the action is clicked the execute
method on the API class will be run. When the action is completed, an event on the host element will be dispatched to notify any surrounding elements.
Default Element
Append a secondary view for a Section, use it for additional features or information.
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
In this section, you can learn how to register and create a custom Section View for the Umbraco backoffice.
The manifest file can be created using either JSON or Typescript. Both methods are shown below.
We can create the manifest using json in the umbraco-package.json
.
The manifest can also be written in TypeScript.
For this typescript example we used a Backoffice Entry Point extension to register the manifests.
Creating the Section View Element using a Lit Element.
my-section.element.ts:
Append a view to any Workspace
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
Workspace Views was previously called Content Apps.
Workspace Views are customizable companion tabs with the ability to take place in any workspace.
In Content Section
With Workspace Views, editors can switch from editing 'Content' to accessing contextual information related to the item they are editing.
The default workspace view is 'Info' - displaying Links, History and Status of the current content item.
Follow the Vite Package Setup by creating a new project folder called "workspaceview
" in App_Plugins
.
Create a manifest file named umbraco-package.json
at the root of the welcome-dashboard
folder. Here we define and configure our dashboard.
Add the following code to umbraco-package.json
:
Add the following code to the existing my-element.ts
from the src
folder:
In the workspaceview
folder run npm run build
and then run the project. Then in the content section of the Backoffice you will see our new Workspace View:
To see the Workspace View that we have created in the content section, first you will need to have some content created.
Property | Type | Description |
---|
(Optional) for when the dashboard should be displayed
Label | string | The label shown to the user |
pathname | string | The routable URL pathname |