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...
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...
Get started with Umbraco UI Builder by understanding its system requirements, versioning, and installation prerequisites.
In this article, you will find the requirements to get started with Umbraco UI Builder. Umbraco UI Builder allows you to create and manage custom UI elements for your Umbraco backoffice.
Umbraco 15+ website configured and ready to install Umbraco UI Builder.
For instructions on installing Umbraco, see the Umbraco CMS Documentation.
To use Umbraco UI Builder, your setup must meet these minimum requirements:
Umbraco CMS version 15+
SQL Server Database (SQLite is acceptable for testing but not recommended for live deployments)
Umbraco UI Builder is an add-on product for Umbraco CMS, and follows the versioning strategy laid out for Umbraco CMS.
Learn about licensing, including coverage, installation, and validation options.
Umbraco UI Builder is a commercial product. You can use Umbraco UI Builder locally without a license. When running Umbraco UI Builder on a public domain the usage is limited to a single editable collection. To remove these restrictions, a valid license is required.
Licenses are sold per backoffice domain and applies to all subdomains. If you have alternative staging/QA environment domains, additional domains can be added to the license on request.
The licenses are not tied to a specific product version. They work across all versions of the related product.
A license for mysite.com
and requested dev domains (devdomain.com
and devdomain2.com
) will cover:
localhost
*.local
*.mysite.com
www.mysite.com
devdomain.com
www.devdomain.com
devdomain2.com
www.devdomain2.com
Only one license per Umbraco installation is allowed.
There are a few differences as to what the licenses cover:
A single license covers the installation of Umbraco UI Builder in one production backoffice domain, as well as in any requested development domains.
The production domain includes all subdomains (e.g. *.mysite.com
).
The development domains work with or without the www
subdomain.
The license allows for an unlimited number of editable collections.
The license also includes localhost
and *.local
as a valid domain.
If you have multiple backoffice domains pointing at the same installation, you can purchase and add additional domains to your license.
This is an add-on domain for existing licenses. Refunds will not be given for this product.
You can look at the pricing, features, and purchase a license on the Umbraco UI Builder page. On this page, you can fill out the form with your project details and requirements.
A member of the Sales team will manage this process. In the process, you will need to provide all domains you wish to have covered by the license such as primary and staging/QA domains. You should then receive a license code to be installed in your solution.
If you require to add additional domains to the license, reach out to the sales team. They will manage your request and take care of the process.
Once you have received your license code it needs to be installed on your site.
Open the root directory of your project files.
Locate and open the appSettings.json
file.
Add your Umbraco UI builder license key under Umbraco:Licenses:Products:Umbraco.UIBuilder
:
You might run into issues when using a period in the product name when using environment variables. Use an underscore in the product name instead, to avoid problems.
To verify that your license is successfully installed:
Log into Umbraco Backoffice.
Navigate to the Settings > License dashboard.
Verify the license status displayed on the dashboard.
Some Umbraco installations will have a highly locked down production environment, with firewall rules that prevent outgoing HTTP requests. This will interfere with the normal process of license validation.
On start-up, and periodically whilst Umbraco is running, the license component used by Umbraco UIBuilder will make an HTTP POST request to https://license-validation.umbraco.com/api/ValidateLicense
.
If it's possible to do so, the firewall rules should be adjusted to allow this request.
If such a change is not feasible, there is another approach you can use.
You will need to have a server, or serverless function, that is running and can make a request to the online license validation service. That needs to run on a daily schedule, making a request and relaying it onto the restricted Umbraco environment.
To set this up, firstly ensure you have a reference to Umbraco.Licenses
version 13.1 or higher. If the version of UIBuilder you are using depends on an earlier version, you can add a direct package reference for Umbraco.Licenses
.
Then configure a random string as an authorization key in configuration. This is used as protection to ensure only valid requests are handled. You can also disable the normal regular license checks - as there is no point in these running if they will be blocked:
Your Internet enabled server should make a request of the following form to the online license validation service:
The response should be relayed exactly via an HTTP request to your restricted Umbraco environment:
A header with a key of X-AUTH-KEY
and value of the authorization key you have configured should be provided.
This will trigger the same processes that occur when the normal scheduled validation completes ensuring your product is considered licensed.
A list of known limitations and issues in Umbraco UI Builder
Umbraco UI Builder strives to closely mimic the content pipeline while adhering to public and supported APIs. This ensures full compatibility with the Data Type suite for property editing. However, some features in the Umbraco Core rely on internal methods, making full support for certain functionalities challenging. Below is a list of known issues.
While Umbraco UI Builder supports persisting tag values, it currently does not write these tags to the cmsTags
database table. This functionality is managed by the internal tagsRepository
, which is not publicly accessible, preventing direct saving in the same manner as Umbraco Core.
Block Editors (Block List/Block Grid) are not currently supported due to casting errors between the JSON string representation and collection property.
An implementation to address this is investigated and will be scheduled for a future major release.
Follow the steps to install Umbraco UI Builder into your Umbraco CMS website.
In this article, you will learn how to install Umbraco UI Builder into your Umbraco CMS implementation.
Run the following command in your web project:
For a class library without UI elements, install:
To install via Visual Studio, follow these steps:
Open Visual Studio and load your project.
Go to Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution...
Select the Browse tab and search for Umbraco.UIBuilder.
Select a version from the Version drop-down based on the Umbraco CMS version you are using.
Click Install.
[Optional] Search for and install Umbraco.UIBuilder.Startup if installing without UI elements.
Ensure that the package reference is added to the .csproj file once the installation is complete:
For details on how to install a license, see the Licensing article.
A guide to using Umbraco UI Builder for creating custom backoffice UIs.
Umbraco UI Builder is a tool for creating custom Backoffice User Interfaces (UIs) in Umbraco using a fluent API.
If you have a custom data store that you want to manage within Umbraco, you can use Umbraco UI Builder. With few lines of code, you can configure a custom administration UI, and reuse many core components with a consistent look and feel.
With Umbraco UI Builder, custom backoffice integrations can now be set up in minutes rather than days.
This documentation is intended for developers with a basic understanding of Umbraco and C#/MVC principles.
If you are new to Umbraco UI Builder, it is recommended to start with the Getting Started section. This section covers system requirements and installation instructions.
Once you have Umbraco UI Builder installed, explore the Guides section. This section provides a quick-start example on configuring Umbraco UI Builder.
Use the main menu to explore features in detail and navigate directly to topics of interest.
For additional resources and best practices, visit the Miscellaneous section.
If you need assistance, refer to our support channels for help and troubleshooting.
Learn how to configure Umbraco UI Builder in your project using two different approaches.
You can configure Umbraco UI Builder either via a Composer or in the Program.cs
.
A Composer is a common approach for registering and configuring services in Umbraco during application startup.
To configure Umbraco UI Builder via a Composer:
Create a file called UIBuilderComposer.cs
in your project.
Implement the IComposer
interface and add the configuration inside the Compose
method:
Program.cs
You can also configure Umbraco UI Builder directly in Program.cs
using the AddUIBuilder
extension method.
To configure Umbraco UI Builder:
Open the Program.cs
file in your project.
Locate the CreateUmbracoBuilder()
method.
Add AddUIBuilder
before AddComposers()
.
The AddUIBuilder
method accepts a delegate function, allowing you to configure your solution using fluent APIs.
Step-by-step guide to migrating a Konstrukt solution to Umbraco UI Builder.
This guide walks you through migrating a default Konstrukt solution to Umbraco UI Builder.
Before starting, review these key changes that impact the migration process.
Replace all existing Konstrukt dependencies with Umbraco UI Builder dependencies.
Remove existing Konstrukt packages:
Delete the Konstrukt App_Plugins
folder:
Install Umbraco.UIBuilder
:
Compile your project against .NET 7.0.
If your configuration is in a single statement, replace AddKonstrukt
with AddUIBuilder
.
Delete obj/bin
folders for a clean build.
Recompile all projects and ensure all dependencies are restored correctly.
Remove existing Konstrukt license files from umbraco\Licenses
folder.
Add your Umbraco.UIBuilder license key to the appSettings.json
file:
Run the project.
Creating your first integration with Umbraco UI Builder.
This guide walks you through a basic implementation of Umbraco UI Builder to manage a custom database table.
Umbraco UI Builder uses PetaPoco as its default persistence layer.
In this section, you will create a Person
table to store data.
To create a Person
table, run the following script in SQL Server Management Studio (SSMS).
This script creates a table for storing people’s details. You may want to populate it with some dummy data for testing.
With the database table created, define the Person
model in your project.
To create a Model:
Create a new folder called Models in your project.
Add a new class file called Person.cs
.
Add the following code:
With the database and model set up, it is time to configure Umbraco UI Builder to work with the Person
model. This will allow you to manage Person
entities from the Umbraco backoffice.
You can configure Umbraco UI Builder either through a Composer or by using the AddUIBuilder
extension method in Program.cs
.
Program.cs
Open the Program.cs
file in your project.
Locate the CreateUmbracoBuilder()
method.
Add AddUIBuilder
before AddComposers()
.
Here’s an example configuration defining a section, a list view, and an editor for managing Person
entities:
After defining the configuration, compile and run your project. To access the newly defined section, you need to give permission to the backoffice user account:
Login to the Umbraco backoffice.
Go to the Users section.
Navigate to the user group you wish to assign the newly defined section.
Submit the changes.
Refresh the browser to view the new section.
If you click on a person's name, you will see the following screen:
This setup allows you to extend and customize your Umbraco site by managing data and entities directly in the backoffice. The simplicity of the implementation allows to create dynamic, user-friendly interfaces for your own data models.
For minor or patch upgrades, check the for breaking changes.
Version 14 introduces breaking changes from the previous Konstrukt product. For full migration details, see the article.
For out-of-support versions, see the .
For a complete sample configuration, see the article.
Update all Konstrukt references to their Umbraco UI Builder alternatives. Ensure you update any Views/Partials that also reference these. See the section for reference.
For multi-step configurations using Action
or Card
classes, update the config builders and base classes to their UI Builder alternatives as described in .
By default, Umbraco UI Builder uses a database for data storage. However, you can configure this using a custom class instead.
The following steps cover the Program.cs
approach. For more details, including configuring via a Composer, see the the article.
Konstrukt.Core
Umbraco.UIBuilder.Core
Konstrukt.Infrastructure
Umbraco.UIBuilder.Infrastructure
Konstrukt.Web
Umbraco.UIBuilder.Web
Konstrukt.Web.UI
Umbraco.UIBuilder.Web.StaticAssets
Konstrukt.Startup
Umbraco.UIBuilder.Startup
Konstrukt
Umbraco.UIBuilder
Learn how to choose and configure the appropriate area for connecting Umbraco UI builder for Umbraco.
Umbraco UI Builder can be integrated into different areas of the Umbraco Backoffice. Before you start managing content, it is essential to decide which area best suits the presentation of your data. Each area offers unique features for displaying and interacting with content.
Once you have identified the most appropriate area, you can proceed with configuring it to suit your needs.
Sections: The Sections area allows you to organize your content in a structured layout, enabling users to navigate different parts of the backoffice.
Dashboards: The Dashboards area is ideal for creating custom views that provide quick access to key information and statistics.
Context Apps: Context Apps provide contextual tools and information based on the specific content a user is working with.
Selecting the correct area is essential to ensure your UI is both functional and user-friendly. Consider the nature of your content and the tasks users need to perform when deciding which area to use.
Learn how to manually upgrade Umbraco UI Builder to the latest version.
This article explains how to manually upgrade Umbraco UI Builder to the latest version. Before upgrading Umbraco UI Builder, see the Version Specific Upgrade Notes for potential breaking changes and common pitfalls.
Before upgrading, take a complete backup of your site and database.
To get the latest version of Umbraco UI Builder, you can upgrade using either of the two options:
To install the latest version via NuGet:
To specify a package version:
After adding the package reference, restore dependencies:
Open Visual Studio.
Navigate to Tools
-> NuGet Package Manager
-> Manage NuGet Packages for Solution...
.
Select Umbraco.UIBuilder.
Choose the latest version from the drop-down and click Install.
After installation, verify the update in your .csproj file:
If you are using any of the following sub-packages, upgrade them as well:
Umbraco.UIBuilder.Core
Core functionality without infrastructure dependencies
Umbraco.UIBuilder.Infrastructure
Infrastructure-specific implementations
Umbraco.UIBuilder.Web
Core logic requiring a web context
Umbraco.UIBuilder.Web.StaticAssets
Static assets for the presentation layer
Umbraco.UIBuilder.Startup
Registers UI Builder with Umbraco
Umbraco.UIBuilder
The main UI Builder package
Get an overview of the things changed and fixed in each version of Umbraco UI Builder.
This section summarizes the changes and fixes introduced in each version of Umbraco UI Builder. Each release includes a link to the UI Builder issue tracker, where you can find a list of resolved issues. Individual issues are also linked for more details.
If there are any breaking changes or other issues to be aware of when upgrading they are also noted here.
If you are upgrading to a new major version, check the breaking changes in the Version Specific Upgrade Notes article.
Below are the release notes for Umbraco UI Builder 15, detailing all changes in this version.
Updated licensing engine.
Fixed issue with import entity action for Umbraco Cloud websites #92.
Added feature to allow server-side complex validation using repository events.
Enable sorting a list view based on the Name
column.
Fixed issue with SetHeading
collection property.
Fixed issue with setting a list view page size programmatically using SetPageSize
.
Fixed an issue with filter input values persistence for filterable properties.
Filterable properties UI updates
Added updates to the licensing engine.
Fixed an error in the entity update action.
Added previously validated license resolver, to validate a license if a validation process was already executed successfully in the past 7 days.
Fixed an issue caused by where
clauses for filter expression and deleted property.
Allow entity properties to be searched based on pattern: StartsWith
| Contains
#116.
Switch entity create/edit header to label view for read-only collections #111.
Product migrated to support the new Web Component-based Umbraco.
You can read more about the new Backoffice in the Umbraco CMS documentation.
You can find the release notes for Konstrukt in the Change log file on GitHub.
Configuring folders to organise trees in Umbraco UI Builder.
Folders help organize trees in Umbraco UI Builder, allowing you to structure content with nested folders and collections. A folder can exist within a tree or as a sub-folder within another folder. Folders can contain either sub-folders or Collections.
To define a folder, use one of the AddFolder
methods on a Tree
or parent Folder
config builder instance.
AddFolder()
MethodAdds a folder to the current tree with the specified name and a default folder icon.
AddFolder()
Method with Custom IconAdds a folder to the current tree with a specified name and icon.
When creating a new folder, an alias is automatically generated. However, if you need a specific alias, you can use the SetAlias
method to override it.
SetAlias()
MethodSets a custom alias for a folder.
SetIconColor()
MethodSets the folder icon color to the given color. The available colors are: black
, green
, yellow
, orange
, blue
, or red
.
AddFolder()
Method for Sub-FoldersAdds a sub-folder inside the current folder with a specified name and a default folder icon.
AddFolder()
Method for Sub-Folders with Custom IconAdds a sub folder to the current folder with a specified name and custom icon.
AddCollection<>()
MethodAdds a collection to the current folder with the given names, descriptions, and default icons. The ID property must be defined. For more details, see the Collections article.
AddCollection<>()
Method with Custom IconsAdds a collection to the current folder with the given names, description and icons. The ID property must be defined. For more details, see the Collections article.
Key User Interface Concepts used by Umbraco UI Builder.
Before diving into Umbraco UI Builder, it’s important to understand some of the fundamental concepts of the Umbraco UI. This knowledge will help you navigate and leverage the UI Builder more effectively, as it uses the same UI components to construct interfaces.
A section in Umbraco is a distinct area within the backoffice where related content and functionality are grouped. For example, the Content section is where content management happens, while the Media section handles media files.
The tree represents the hierarchical structure of items within a section. It organizes content, settings, and data, for quick navigation and locating items. For example, the content tree shows the pages of a website in a nested format.
Each section in the Umbraco backoffice typically starts with a dashboard. This is an introductory screen for the section. It often includes useful links or shortcuts, providing an overview or quick access to the most commonly used features.
The collection displays a list of items in a tree or grid view. It provides an overview of content or data in a table format, with sortable columns and the option to filter or search through the items. This view is used when you need to work with multiple items at once.
The editor is where the main content editing occurs. It is structured using tabs, fieldsets, and fields. Tabs organize different sections of content, and fieldsets group related fields together. Each field represents a specific piece of data, such as a text box or an image upload.
Workspace Views are additional functionality that can be added to an editor. They provide extra features based on the content of the item being edited. For instance, a media content app might allow you to resize or crop an image directly from the editor.
Tabs are used to organize content within the editor, allowing users to switch between different sections of a content item. For example, one tab might contain the general settings, while another contains media or advanced options.
A menu item represents an action within the context of a tree node or a list item. It is a clickable item that triggers specific tasks, such as deleting or editing an item.
Bulk actions allow you to perform an operation on multiple items in the list view at once. For example, you might use a bulk action to delete multiple content items or update their status in a single step.
Configuring collection in Umbraco UI Builder, the backoffice UI builder for Umbraco.
A collection is the cornerstone Umbraco UI Builder config and it represents a collection of entities for a given data model. From this config object, you can configure everything about how this collection integrates into the UI. You can also configure how it should display in a list view as well as how it should be edited.
Get started by reviewing the basics of collection configuration.
Configuring Dashboards in Umbraco UI Builder.
Dashboards in Umbraco UI Builder provide an intuitive way to present important information and tools at the root of a section within the Umbraco backoffice. They serve as a starting point for users, offering quick access to relevant data, insights, or actions. Dashboards can be customized, reordered, and configured to display for specific user groups, making them a flexible tool for enhancing the backoffice experience. When multiple dashboards are available in a section, they appear in a tabbed layout for easy navigation.
You can define a dashboard by calling one of the AddDashboard
methods on a SectionConfigBuilder
or a WithSectionConfigBuilder
instance.
AddDashboard()
MethodAdds a dashboard with the specified name.
AddDashboardBefore()
MethodAdds a dashboard with the specified name before the dashboard with the given alias.
AddDashboardAfter()
MethodAdds a dashboard with the specified name after the dashboard with the given alias.
SetAlias()
MethodSets the alias of the dashboard. By default, an alias is automatically generated based on the supplied name. If a specific alias is required, the SetAlias
method can be used to override the default.
Dashboard visibility can be controlled using ShowForUserGroup
and HideForUserGroup
, which specify which user groups can see the dashboard. These settings can be applied multiple times for different user roles.
By default, dashboards are pre-filtered to display only in their defined section. This filtering is combined with the SetVisibility
method to control when a dashboard appears.
SetVisibility()
MethodDefines visibility rules for the dashboard.
A dashboard can display only one collection. To display multiple collections, multiple dashboards must be configured.
SetCollection<>()
MethodAssigns a collection to the dashboard with the specified names, descriptions, and default icons. The ID property must be defined. For more details, see the Collections article.
SetCollection<>()
Method with Custom IconsAssigns a collection to the dashboard with the specified names, descriptions, and custom icons. The ID property must be defined. For more details, see the Collections article.
Configuring and customizing sections in Umbraco UI Builder to organize and manage the backoffice interface effectively.
A section in Umbraco represents a distinct area within the backoffice, such as content, media, and so on. Sections are accessible via links in the main menu at the top of the Umbraco interface. Using Umbraco UI Builder, multiple sections can be defined to organize the management of models logically.
Sections are defined using the AddSection
method on the root-level UIBuilderConfigBuilder
instance.
AddSection()
MethodThis method adds a new section to the Umbraco menu with the specified name, allowing custom areas for organizing content in the backoffice.
AddSectionBefore()
MethodThis method adds a section before another section with the specified alias, allowing for customized ordering of sections in the backoffice.
AddSectionAfter()
MethodThis method adds a section after another section with the specified alias, allowing for a custom order of sections in the backoffice.
SetAlias()
MethodThis method sets a custom alias for the section.
Optional: By default, an alias is automatically generated from the section's name. To customize the alias, the SetAlias()
method can be used.
Tree()
Method for ConfigurationThis method configures the tree structure for the section, which is used to organize content types. For more information, see the Trees article.
AddDashboard()
MethodThis method adds a dashboard to the section with the specified alias, providing tools and features for content management. For more information, see the Dashboards article.
AddDashboardBefore()
to Place a DashboardThis method adds a dashboard before another dashboard with the specified alias, allowing custom placement in the section. For more information, see the Dashboards article.
AddDashboardAfter()
to Place a DashboardThis method adds a dashboard after another dashboard with the specified alias, giving control over dashboard order. For more information, see the Dashboards article.
You can extend existing sections by adding Umbraco UI Builder trees and dashboards, context apps, and virtual subtrees. This can be done by calling the WithSection
method on the root-level UIBuilderConfigBuilder
instance.
WithSection()
This method extends an existing section with additional configuration, enabling more customization for existing areas.
AddTree()
MethodThis method adds a tree to the section, helping to visualize and organize content types. For more information, see the Trees article.
AddTree()
MethodThis method adds a tree within a specified group, improving content organization by grouping related trees together. For more information, see the Trees article.
AddTreeBefore()
to Position a TreeThis method adds a tree before another tree within the section, allowing you to customize the tree order. For more information, see the Trees article.
AddTreeAfter()
to Position a TreeThis method adds a tree after another tree within the section, enabling specific ordering of trees. For more information, see the Trees article.
AddDashboard()
MethodThis method adds a new dashboard to the section with the specified name. For more information, see the Dashboards article.
AddDashboardBefore()
MethodThis method adds a dashboard before the dashboard with the specified alias. For more information, see the Dashboards article.
AddDashboardAfter()
MethodThis method adds a dashboard after the dashboard with the specified alias. For more information, see the Dashboards article.
Configuring context apps in Umbraco UI Builder.
Context Apps in Umbraco UI Builder function similarly to Content Apps. They provide contextual applications within the content editor UI. By defining context apps, you can expose collections that are directly related to the content in question. For example, blog post comments can be linked to their respective blog posts and managed in context through a content app.
AddContextApp()
MethodAdds a context app with the specified name and default icon.
AddContextApp()
Method with Custom IconAdds a context app with the specified name and custom icon.
AddContextAppBefore()
MethodAdds a context app with the specified name and default icon before another context app specified by its alias.
AddContextAppBefore()
Method with a Custom IconAdds a context app with the specified name and custom icon before another context app specified by its alias.
AddContextAppAfter()
MethodAdds a context app with the specified name and default icon after another context app specified by its alias.
AddContextAppAfter()
Method with a Custom IconAdds a context app with the specified name and custom icon after another context app specified by its alias.
SetAlias()
MethodSets the alias of the context app. By default, an alias is automatically generated from the context app's name. You can use the SetAlias
method to specify a custom alias.
SetIconColor()
MethodSets the context app icon color to the given color. The available colors are: black
, green
, yellow
, orange
, blue
or red
.
Context app visibility is controlled by a delegate that takes a ContextAppVisibilityContext
instance. This method contains a Source
property which holds a reference to the source object that the content app is being displayed on (i.e., an IContent
instance). It also holds a reference to a UserGroups
collection of the currently logged-in user's user groups. You can use these values to determine when the context app should be displayed.
By default, context apps are pre-filtered to only appear on the tree they are defined in. This default behavior is combined with the SetVisibility configuration to control visibility.
SetIconColor()
MethodDefines the visibility of the context app based on a delegate expression.
Context apps can consist of one or more collections. If a context app contains multiple collections, the collection list views will be displayed in tabs within the context app.
AddCollection<>()
MethodAddCollection<>()
Method with Custom IconAddCollection<TEntityType>(Lambda idFieldExpression, Lambda fkFieldExpression, string nameSingular, string namePlural, string description, string iconSingular, string iconPlural, Lambda collectionConfig = null) : ContextAppConfigBuilder
Configuring field views in Umbraco UI Builder, the backoffice UI builder for Umbraco.
Field Views allow you to customize the markup used by a field when displayed in a list view. Field Views are implemented as .NET Core View Components that are passed a single FieldViewsContext
argument with information about the entity/field being rendered.
You can define a field view in one of two ways.
FieldView
view componentThe simplest way to define a field view for non-complex fields is to place a view file in the /Views/Shared/Components/FieldView
folder with the following markup.
When registering a basic file view you can pass the name of the view file (excluding the .cshtml
file extension) to the relevant API method.
To define a more complex field view you can create your own view component class (which can use dependency injection for any required dependencies). This can be done by using the following signature:
It's important to know that the FieldViewContext
parameter to the InvokeAsync
method MUST be named context
.
For the view element of your component, based on the example above, you would place a file Default.cshtml
into the /Views/Shared/Components/MyComplexFieldView
folder with the following markup:
Field view components are passed a FieldViewContext
object with the following information:
Configuring **one-to-many** relationships in Umbraco UI Builder, the backoffice UI builder for 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.
Retrieving child collections in one-to-many relationships with UI Builder, can be achieved with the support of child repositories. One-to-many relations are where one parent entity of a collection is associated with multiple entities from another.
The models would look like this:
You can create child repository instances via the IRepositoryFactory
and use them to retrieve information from the child collection.
Configuring and customizing Trees to organize and manage the backoffice interface effectively.
A tree is a hierarchical structure that organizes sections into sub-sections. It appears in the main side panel of the Umbraco interface. In Umbraco UI Builder, each section can only have one tree definition, but you can use folder nodes to organize the tree.
Tree()
MethodThis method defines the structure and behavior of a tree within a section.
AddTree()
methodThis method adds a tree to the current section, specifying its name and icon.
AddTree()
MethodThis method adds a tree to the current section under a specified group.
AddTreeBefore()
to Position a TreeThis method adds a tree to the current section before the tree with the specified alias.
AddTreeAfter()
to Position a TreeThis method adds a tree to the current section after the tree with the specified alias.
SetIconColor()
MethodThis method changes the color of the tree’s icon. The available options are black
, green
, yellow
, orange
, blue
, or red
.
Only trees in existing sections have an icon. Trees in Umbraco UI Builder sections display the tree contents directly.
AddGroup()
MethodThis method adds a group to the current tree with the specified name.
Only trees in Umbraco UI Builder sections support groups.
AddFolder()
MethodAddFolder()
Method with Custom IconAddCollection<>()
MethodAddCollection<>()
Method with IconsWithTree()
MethodThis method starts a sub-configuration for an existing tree with the specified alias.
AddContextApp()
MethodAddContextApp()
Method with Custom IconAddContextApp()
Method Before Another Context AppAddContextApp()
Method with Custom Icon Before Another Context AppAddContextApp()
Method After Another Context AppAddContextApp()
Method with Custom Icon After Another Context AppConfiguring child collection groups in Umbraco UI Builder, the backoffice UI builder for 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.
A child collection group is a container for other child collections. Its purpose is mainly to provide a logical grouping of multiple child collections to help with organization and an improved user experience.
You can define a child collection group by calling one of the AddChildCollectionGroup
methods on a given collection config builder instance.
Adds a child collection group to the current collection with the given name and default icon.
Adds a child collection group to the current collection with the given name and icon.
Configuring child collections in Umbraco UI Builder, the backoffice UI builder for 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.
You define a child collection by calling one of the AddChildCollection
methods on a given collection config builder instance.
Adds a child collection to the current collection with the given names and description and default icons. A property accessor expression is required for both the entity ID field and FK (Foreign Key) field of the entity.
Adds a child collection to the current collection with the given names, description and icons. A property accessor expression is required for both the entity ID field and FK (Foreign Key) field of the entity.
Configure search functionality in Umbraco UI Builder.
Umbraco UI Builder includes a search API for filtering and locating specific entities within a collection. This enhances usability, especially in collections with large datasets.
Get started by reviewing how to define searchable properties.
Configuring the editor of a collection in Umbraco UI Builder, the backoffice UI builder for Umbraco.
An editor is the user interface used to edit an entity and is made up of tabs and property editors.
Accesses the editor config of the given collection.
Adds a tab to the editor.
A slidebar is a smaller area that is displayed to the right of the main editor. The sidebar can also contain fieldsets and fields in the same way tabs can. However, it is a much more limited display area so you'll need to choose your field types carefully. The sidebar is a great location to display entity metadata.
Configures the sidebar for the tab.
Sets the runtime visibility of the tab.
Adds the given fieldset to the tab.
Sets the runtime visibility of the fieldset.
Adds the given property to the editor.
By default, Umbraco UI Builder will build the label from the property name, including splitting camel case names into sentence cases. However, you can set an explicit label if preferred.
Sets the label for the editor field.
Sometimes you may have a field editor that would work better in full width. You can achieve this by explicitly hiding the field label.
Hides the label for the editor field.
Sets the description for the editor field.
By default, Umbraco UI Builder will automatically choose a relevant Data Type for basic field types. However, if you wish to use an alternative Data Type then you can override this.
Set the Data Type of the current field to the Umbraco Data Type with the given name.
Set the Data Type of the current field to the Umbraco Data Type with the given id.
Sets the default value to a known constant.
Sets the default value via a function that gets evaluated at time of entity creation.
Makes the given field required.
Defines the regular expression to use when validating the field.
Makes the current field read-only disabling editing in the UI.
Makes the current field read-only disabling editing in the UI. Provides a custom formatting expression to use when rendering the value as a string.
Makes the current field read-only disabling editing in the UI. Provides the name or id of a datatype to use when in read-only mode.
Makes the current field read-only disabling editing in the UI if the given runtime predicate is true.
Makes the current field read-only disabling editing in the UI if the given runtime predicate is true. Provides a custom formatting expression to use when rendering the value as a string.
Makes the current field read-only disabling editing in the UI if the given runtime predicate is true. Provides the name or id of a datatype to use when in read-only mode.
Sets the runtime visibility of the field.
You can define a context app by calling one of the AddContextApp
methods on a instance.
Adds a collection to the current context app with the specified names, descriptions, and default icons. Each collection requires an ID field and a foreign key field, linking to Umbraco node UDI values. For more details, see the article.
Adds a collection to the current context app with the specified names, descriptions, and custom icons. Each collection requires an ID field and a foreign key field, linking to Umbraco node UDI values. For more details, see the article.
A field view is assigned to a list view field as part of the list view configuration. For more information you can check the .
The tree configuration for Umbraco UI Builder sections is part of the config builder and is accessed via its Tree
method.
To add a tree to an existing section, use one of the AddTree
methods from the config builder.
This method adds a folder node inside a tree or group, using the default folder icon. For more details, see the article.
This method adds a folder with a specified icon inside a tree or group. For more details, see the article.
This method adds a collection to the current tree or group, specifying its names, descriptions, and default icons. The ID property must be defined. For more details, see the article.
This method adds a collection to the current tree or group, specifying its names, descriptions, and custom icons. The ID property must be defined. For more details, see the article.
To extend existing trees, call the WithTree
method on a instance.
This method adds a context app with the specified name and default icon. For more details, see the article.
This method adds a context app with the specified name and custom icon. For more details, see the article.
This method adds a context app with the specified name and default icon before the specified context app alias. For more information, see the article.
This method adds a context app with the specified name and custom icon before the specified context app alias. For more information, see the article.
This method adds a context app with the specified name and default icon after the specified context app alias. For more information, see the article.
This method adds a context app with the specified name and custom icon after the specified context app alias. For more information, see the article.
A child collection is a container for a given data model that is tied to a parent collection data model. It shares all of the config builder API except child collections cannot contain further child collections.
Child Collections UI: By default, child collections will be presented in the UI as context apps in the parent models editor view. If you have multiple child collections that make the context apps area overpopulated, you can use the . By using this you can group child collections under a single context app with the inner child collections then being presented in tabs.
Child collections share the same API as the Collection
config builder API, except child collections cannot contain further child collections. For more information check the .
The editor configuration is a sub-configuration of a config builder instance and is accessed via its Editor
method.
Configuring a global filter in Umbraco UI Builder, the backoffice UI builder for Umbraco.
If you want to work with a subset of data within a given collection then this is where the global filters come in handy. These allow you to define a filter to apply to all queries for a given collection.
Applying a global filter is controlled via the collections configuration.
Sets the filter where clause expression. Expression must be a boolean
expression.
Configuring data views builders in Umbraco UI Builder, the backoffice UI builder for Umbraco.
Data views builders allow you to create a collection data views list dynamically at run time. By default, Umbraco UI Builder will use the hard-coded data views defined in your Umbraco UI Builder config. However, if you need to build your data views list dynamically, then this is when you'd use a data views builder.
When Umbraco UI Builder resolves a data views builder it will attempt to do so from the global DI container. This means you can inject any dependencies that you require for your builder. If there is no type defined in the DI container, Umbraco UI Builder will fall-back to manually instantiating a new instance of value mapper.
To define a data views builder you can create a class that inherits from the base class DataViewsBuilder<TEntityType>
and implements the abstract methods.
The required methods are:
GetDataViews: Returns the list of data views to choose from.
GetDataViewWhereClause: Returns the boolean where clause expression for the given data views alias.
Setting a data views builder is controlled via the collections configuration.
Sets the collections data views builder which allows you to define the data views dynamically at run time.
Sets the collections data views builder which allows you to define the data views dynamically at run time.
Sets the collections data views builder which allows you to define the data views dynamically at run time.
The basics of a collection configuration in Umbraco UI Builder, the backoffice UI builder for Umbraco.
There is a lot that can be configured from the collection config, but what follows are the core basics. You can find more configuration options about specific topics from the other configuration sections in the main menu.
You can define a collection by calling one of the AddCollection
methods on a given Tree
or parent Folder
config builder instance.
Adds a collection to the given container with the given names and description and default icons. An ID property accessor expression is required so that Umbraco UI Builder knows which property is the ID property.
Adds a collection to the given container with the given names, description and icons. An ID property accessor expression is required so that Umbraco UI Builder knows which property is the ID property.
Sets the alias of the collection.
Optional: When creating a new collection, an alias is automatically generated from the supplied name for you. However, if you need a specific alias you can use the SetAlias
method to override this.
Sets the collection icon color to the given color. Possible options are black
, green
, yellow
, orange
, blue
or red
.
Within Umbraco, it is expected that an entity has a name property. So we need to let Umbraco UI Builder know which property to use for the name. If the entity doesn't have a name property, then it needs to know how to construct a name from an entity's other properties. We do this by using either the SetNameProperty
or SetNameFormat
methods on a Collection
config builder instance.
Sets which property of your entity to use as the name property. Property must be of type string
. By defining a property as the name property, its value will be used as the label for the entity in trees and list views. It will also be editable in the header region of the editor interface. The property will also automatically be added to the searchable properties collection and be used for the default sort property.
Sets which property of your entity to use as the name property and what custom heading should the list view column heading be. Property must be of type string
. By defining a property as the name property, its value will be used as the label for the entity in trees and list views. It will also be editable in the header region of the editor interface. The property will also automatically be added to the searchable properties collection and be used for the default sort property.
Sets a format expression to use to dynamically create a label for the entity in things like trees and list views. By providing a name format it is assumed there is no single name property available on the entity. And as such none of the default behaviors described for the SetNameProperty
method will apply.
Sets which property of our entity to sort against, defaulting to ascending sort direction.
Sets which property of our entity to sort against in the provided sort direction.
Sets which property of our entity to use as the date created property. Property must be of type DateTime
. When set and a new entity is saved via the repository, then the given field will be populated with the current date and time.
Sets which property of our entity to use as the date modified property. Property must be of type DateTime
. When set and an entity is saved via the repository, then the given field will be populated with the current date and time.
By default, in Umbraco UI Builder any entity that is deleted via the Umbraco UI Builder repository is definitively removed from the system. The SetDeletedProperty
method can be used if needed to keep the records in the data repository despite having them marked as deleted. This is so they do not show the the UI.
Sets which property of our entity to use as the deleted property flag. Property must be of type boolean
or int
. When a deleted property is set, any delete actions will set the deleted flag instead of deleting the entity. For boolean
based properties, deleted entities will have a value of True
when deleted. For int
based properties, deleted entities will have a UTC Unix timestamp value of the date the entity was deleted. In addition, any fetch actions will also pre-filter out any deleted entities.
Disables the option to create entities on the current collection. An entity could be created via code and only then editing is allowed in the UI for example.
Disables the option to create entities on the current collection if the given runtime predicate is true. An entity could be created via code and only then editing is allowed in the UI.
Disables the option to update entities on the current collection. An entity can be created, but further editing is not allowed.
Disables the option to update entities on the current collection if the given runtime predicate is true. An entity can be created, but further editing is not allowed.
Disables the option to delete entities on the current collection. Useful if the data needs to be retained and visible. See also configuring soft deletes.
Disables the option to delete entities on the current collection if the given runtime predicate is true. Useful if the data needs to be retained and visible. See also configuring soft deletes.
Sets the collection as read-only and disables any Create, Read, Update, and Delete (CRUD) operations from being performed on the collection via the UI.
Sets the collection as read-only if the given runtime predicate is true. It also disables any Create, Read, Update, and Delete (CRUD) operations from being performed on the collection via the UI.
Sets the runtime visibility of the collection.
By default, Umbraco UI Builder will use the Umbraco connection string for its database connection. However, you can change this by calling the SetConnectionString
method on a Collection
config builder instance.
Sets the connection string name for the given collection repository.
Configuring actions in Umbraco UI Builder, the backoffice UI builder for Umbraco.
Actions are a powerful way of adding custom functionality to Umbraco UI Builder without needing to create custom UI elements. By providing an action to run, Umbraco UI Builder can automatically trigger actions from a number of UI locations.
To define an action create a class that inherits from the base class Action<>
and configure it like below:
The required configuration options are:
Name: The name of the action.
Alias: A unique alias for the action.
Icon: An icon to display next to the name in the action button.
Execute: The method to run against a given list of entities.
Additional optional configuration options are:
ConfirmAction: Set whether a confirm dialog should display before performing this action.
The generic argument is a return type for the action. See Controlling the action result below.
You can use dependency injection to inject any services you require to perform your specific task. When injecting dependencies, it's always recommended that you inject Lazy<YourService>
implementations of the required services to ensure they are only resolved when needed.
Actions by default will return a ActionResult
but you can return other types of result by swapping the Action<>
generic argument.
ActionResult
- Standard result with a boolean Success
value.
FileActionResult
- Returns a file stream / bytes and triggers a download dialog.
Sometimes you may need to collect further user input before you can perform an action. To achieve this you can use the Action<>
base class that accepts an additional TSetting
generic argument.
By implementing this base class you are required to implement an additional Configure
method which accepts a SettingsConfigBuilder<>
parameter. You should use this parameter calling the builders fluent API to define the settings dialog UI and how it maps to the settings type. With the settings config builder you are able to create fieldsets and fields with the same fluent API as defined in the Collection Editors section.
In addition to this Configure
method, the Execute
method will now accept an additional settings
parameter of the settings type. This will be pre-populated by Umbraco UI Builder with the value entered by the user, allowing you to alter your actions behavior accordingly.
Actions are added via the Collections configuration.
Adds an action of the given type to the collection.
Adds an action of the given type to the collection.
Adds the given action to the collection.
Configuring custom cards in Umbraco UI Builder, the backoffice UI builder for Umbraco.
Custom cards allow you to perform more complex metric calculations and are defined via a class implementing the Card
base class.
When Umbraco UI Builder resolves a card it will attempt to do so from the global DI container. This means you can inject any dependencies that you require for your card to calculate its value. If there is no type defined in the DI container, Umbraco UI Builder will fall-back to manually instantiating a new instance of value mapper.
To define a card you create a class that inherits from the base class Card
and configure it within the constructor like so.
The required configuration options are:
Name: The name of the card.
Alias: A unique alias for the card.
GetValue(object parentId = null): A method to get the cards value.
Additional optional configuration options are:
Icon: An icon to display in the card.
Color: The color of the card.
Suffix: A suffix to display after the card value.
Adds a card of the given type to the collection.
Adds a card of the given type to the collection.
A list of inbuilt actions that come with Umbraco UI Builder, the backoffice UI builder for Umbraco.
Umbraco UI Builder comes with some inbuilt actions that are available for you to use straight away.
Namespace Umbraco.UIBuilder.Infrastructure.Configuration.Actions
Provides a Comma-Separated Values (CSV) export functionality converting all properties to column headings and rendering each entity property values on each row.
Namespace Umbraco.UIBuilder.Infrastructure.Configuration.Actions
Provides a Comma-Separated Values (CSV) import functionality matching column headings with entity properties and mapping row values to an entity.
Configuring data views in Umbraco UI Builder, the backoffice UI builder for Umbraco.
Data views allow you to define multiple, pre-filtered views of the same data source. This can be useful when entities exist in different states and you want a way to toggle between them.
Data views are defined via the collections configuration.
Adds a data view with the given name and where clause filter expression. Expression must be a boolean
expression.
Adds a data view with the given group, name and where clause filter expression. Expression must be a boolean
expression.
Configure searchable properties in Umbraco UI Builder.
Searchable properties allow you to define any String
based properties in a model. It can be searched via Umbraco UI Builder's list view and entity picker search controls.
Both direct String
properties and String
properties within nested objects can be made searchable, provided the parent object is not null
.
AddSearchableProperty()
MethodUse AddSearchableProperty
to specify which properties should be included in search functionality.
The search behavior differs based on the version:
Up to version 15.0.1: Search uses the StartsWith
method, meaning results include entries that begin with the search term.
Version 15.0.1 and later: Search can be configured to use Contains
, allowing results that include the search term anywhere within the property value.
Configuring **many-to-many** relationships in Umbraco UI Builder, the backoffice UI builder for 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.
Related collections add support for editing many-to-many relationships with UI Builder. These are found when multiple entities from one collection are associated with multiple entities from another. They are modeled in a database via two tables related to a junction table.
A classic example is with Students
and Courses
. Each course has many students, and each student takes many courses.
A representation of your collections would look like this:
And the entities would be represented using the following Models:
You can get started with related collection through a two step process:
Add collection definition
Add related collection entity picker and definition
Define a related collection by calling the AddRelatedCollection
method on a given collection config builder instance.
Adds a related collection to the current collection with the given names, descriptions, and default icons. A property accessor expression is required for the entity ID field of the entity. The relation configuration will define the junction entity by specifying the references to parent and child entities.
Define the child collection entity picker by calling the AddRelatedCollectionPickerField
method on the parent collection fieldset config.
Adds an entity picker with the specified Data Type name to the editor of the parent collection.
Relation Config Alias: The relation config alias must correspond to the related collection picker field alias! (e.g. studentsCourses
)
Retrieves the related collections based on the ID of the parent entity.
Adds a new related collection to the current parent entity.
Configuring filterable properties in Umbraco UI Builder, the backoffice UI builder for Umbraco.
Umbraco UI Builder can dynamically build a filter dialog choosing appropriate editor views for you based on a basic property configuration. Properties of a number or date types will become range pickers and enums. Properties with options defined will become select/checkbox lists and all other properties will become text input filters.
Defining filterable properties is controlled via the collections configuration.
Adds the given property to the filterable properties collection.
For filterable properties with options you can configure whether the options should be multiple or single choice.
Configuring filtering in Umbraco UI Builder, the backoffice UI builder for Umbraco.
Beyond searching there might be times when you need to be able to create specific views of a collection's data. To help with this Umbraco UI Builder has different filtering mechanisms available.
Choose a filtering method from the list below to find out more.
Configuring actions in Umbraco UI Builder, the backoffice UI builder for Umbraco.
Actions provide an API to perform custom tasks against a collection and its entities from multiple locations in the UI. Examples: menu actions, bulk actions, or individual table row actions.
Get started with actions by learning about the basics.
Property Editors available with Umbraco UI Builder, the backoffice UI builder for Umbraco.
As well as the API for managing your custom data source, Umbraco UI Builder also comes with some property editors. Those property editors help you work with your data inside Umbraco content nodes.
The property editors available are:
Configuring cards in Umbraco UI Builder, the backoffice UI builder for Umbraco.
Cards provide an API to display basic summary information in a card-based format and are useful for displaying key metrics about a collection.
Cards can be defined in one of two ways:
Configuring value mappers in Umbraco UI Builder, the backoffice UI builder for Umbraco.
A value mapper is an Umbraco UI Builder helper class that sits between the editor UI and the database. It also lets you tweak the stored value of a field. By default Umbraco UI Builder will save a datatype value as it would be stored in Umbraco. Value mappers let you change this.
When Umbraco UI Builder resolves a value mapper it will attempt to do so from the global DI container. This means you can inject any dependencies that you require for your mapper. If there is no type defined in the DI container, Umbraco UI Builder will fall-back to manually instantiating a new instance of value mapper.
To define a mapper create a class that inherits from the base class ValueMapper
and implements the methods EditorToModel
and ModelToEditor
.
Value mappers are defined as part of a collection editor field configuration.
Set the value mapper for the current field.
Set the value mapper for the current field.
Set the value mapper for the current field.
Configuring encrypted properties in Umbraco UI Builder, the backoffice UI builder for Umbraco.
If needed to collect sensitive information in a collection but don't want to persist in a plain text format to the data storage mechanism. Umbraco UI Builder can help with this by allowing you to define properties as encrypted. After which any time the value is persisted or retrieved from persistence, Umbraco UI Builder will automatically encrypt and decrypt the value.
Umbraco UI Builder uses the IDataProtectionProvider
instance registered in the DI container to perform its encryption/decryption. If you need to change the encryption algorithm, you should replace the IDataProtectionProvider
instance in the DI container.
Adds the given property to the encrypted properties collection. Property must be of type String
. When set, the property will be encrypted/decrypted on write/read respectively.
Configuring a summary dashboard to provide an overview of collections within a section.
A summary dashboard appears automatically at the root of an Umbraco UI Builder section. It provides an overview of key collections within that section, enabling quick access to list views. Additionally, it allows for adding new entries to the collection, provided the collection is not set to read-only.
By summarizing important data and simplifying navigation, the summary dashboard improves content management efficiency.
To display a collection on the summary dashboard, use the ShowOnSummaryDashboard()
method in the collection configuration.
Code Reference: ShowOnSummaryDashboard() : CollectionConfigBuilder<TEntityType>
Only root-level collections within a section can be displayed on the summary dashboard.
Controlling the visibility of actions in Umbraco UI Builder, the backoffice UI builder for Umbraco.
By default actions are not visible in the UI and you must expressly define when and where an action should display. This can be achieved in two ways, either on the action definition itself or at the point of registration on the collections config.
To define the default visibility of an action at the action level you can do this by overriding the IsVisible
method of the Action<>
base class.
Adds an action of the given type to the collection with the given visibility.
Adds an action of the given type to the collection with the given visibility.
Adds the given action to the collection with the given visibility.
When controlling the visibility of an action you will be given a ActionVisibilityContext
object from which you can decide whether to show the action or not. The visibility context contains two key pieces of information on which you can base this decision.
The action type property is an enum property that define which area of the UI it is that wishes to access this action. Enabling an action to display for a given action type will determine where an action is displayed.
The ContainerMenu
action type determines that the action will be displayed in both the tree of the collection and its list view actions menu.
The EntityMenu
action type determines that the action will be displayed in the actions menu of a collection editor UI.
The Bulk
action type determines that the action will be displayed in the collection list view bulk actions menu.
The Row
action type determines that the action will be displayed in the collection list view action row menu.
The Save
action type determines that the action will be displayed as a sub button in an entity editors save button. All Save
action types trigger a save before the action is executed and so to convey this, all Save
action type button labels are prefixed Save & [Action Name]
The user groups collection contains a list of Umbraco IReadOnlyUserGroup
objects for the current logged-in backoffice user. This allows you to control the visibility of actions for given user group members.
Conventions used by Umbraco UI Builder, the backoffice UI builder for Umbraco.
Most configuration methods in Umbraco UI Builder aim to be fluent. This means that they return a relevant config instance allowing to chain multiple methods calls together in one. For those who prefer to be a bit more verbose, many methods also accept an optional lambda expression. This allows you to pass in a delegate to perform the inner configuration of the element being defined.
Throughout the API, where a method name starts with Add then multiple configurations can be declared. Whereas if a method name starts with Set then only one instance of the configuration can be declared within the current configuration context.
Configuring count cards in Umbraco UI Builder, the backoffice UI builder for Umbraco.
Cards allow you to display basic summaries of key information that may be useful to the editor.
Adds a card with the given name and where clause filter expression. Expression must be a boolean
expression.
Adds a card with the given name + icon and where clause filter expression. Expression must be a boolean
expression.
Sets the color of the card.
Sets the suffix of the card value.
Sets the format expression for the card.
Configuring repositories in Umbraco UI Builder, the backoffice UI builder for Umbraco.
Repositories are used by Umbraco UI Builder to access the entity data stores. By default, collections will use a generic built-in NPoco repository. However, you can define your own repository implementation should you wish to store your entities via an alternative strategy.
To define a repository create a class that inherits from the base class Repository<TEntity, TId>
and implements all of its abstract methods.
Note: For all Impl
methods there are public alternatives without the Impl
suffix. However, there are separate implementation methods in order to ensure all repositories fire the relevant Umbraco UI Builder events. This is whether triggered via the Umbraco UI Builder's UI or not.
Sets the repository type to the given type for the current collection.
Sets the repository type to the given type for the current collection.
To help with accessing a repository (default or custom) Umbraco UI Builder has an IRepositoryFactory
you can inject into your code base. This includes a couple of factory methods to create the repository instances for you. Repositories should only be created via the repository factory as there are some injected dependencies that can only be resolved by Umbraco UI Builder.
Creates a repository for the given entity type. Umbraco UI Builder will search the configuration for the first section/collection with a configuration for the given entity type. Then it will use that as a repository configuration.
Creates a repository for the given entity type from the collection with the given alias.
Configuring event handlers in Umbraco UI Builder, the backoffice UI builder for Umbraco.
Umbraco UI Builder fires a number of notification events during regular operation to allow for extending of the default behaviour.
Then register your event handler in the Program.cs
file like below:
Raised when the repository Save
method is called and before the entity has been persisted. The notification contains an Entity
property with Before
and After
inner properties. These properties provide access to a copy of the currently persisted entity (or null if a new entity) and the updated entity that´s saved. Changes can be made to the After
entity and they will be persisted as part of the save operation. If the Cancel
property of the notification is set to true
then the save operation will be canceled and no changes will be saved.
Raised when the repository Save
method is called and after the entity has been persisted. The notification contains an Entity
property with Before
and After
inner properties. These properties provide access to a copy of the previously persisted entity (or null if a new entity) and the updated entity that´s saved.
Raised when the repository Delete
method is called and after the entity has been deleted. The notification contains an Entity
property providing access to a copy of the entity that´s deleted.
Raised when the repository is preparing a SQL query. The notification contains the collection alias + type, the NPoco Sql<ISqlContext>
object, and the where clause/order by clauses. These will be used to generate the SQL query.
Raised when the repository has repaired a SQL query. The notification contains the collection alias + type, the NPoco Sql<ISqlContext>
object and the where clause/order by clauses that was used to generate the SQL query.
Starting with version 15.1.0
, complex server-side validation can be added to a collection by calling the CancelOperation
method of the notification.
Using the entity picker property editor with Umbraco UI Builder, the backoffice UI builder for Umbraco.
The Entity Picker property editor is an Umbraco property editor that lets you select one or more entities from an Umbraco UI Builder collection.
To configure an entity picker you need to create a Data Type in the Umbraco backoffice. From the property editor dropdown choose 'Umbraco UI Builder Entity Picker'.
From there choose 'Section' and 'Collection' you wish to pick entities from. You can also choose an optional list view 'Data View' if there are any configured.
You can also set a minimum and maximum number of items to be able to pick if required.
With an entity picker Data Type defined, finish off the configuration by adding it to the desired Document Type definition.
Using the entity picker should be pretty familiar as it aims to mimic the content picker as closely as possible.
To pick an entity click the 'Add' link to launch the picker dialog. The dialog should present a paginated list of entities to pick from. If any searchable fields were configured for the entity type, you can perform a search by typing a search term in the search input field.
To pick your items click on the entity names and then click 'Select' in the bottom right-hand corner.
The picker should display a summary of the selected entities which can be sorted by dragging the selected entities into the desired order.
To save the value either save or save and publish the current document.
Configuring the list view of a collection in Umbraco UI Builder, the backoffice UI builder for Umbraco.
A list view is a list-based view of a collection entity providing features: pagination for large collections, custom data views, searching, and bulk actions.
Accesses the list view config of the given collection.
Adds the given property to the list view.
Sets the heading for the list view field.
Sets the format expression for the list view field.
Sets the view component for the list view field.
Sets the view component for the list view field.
Sets the runtime visibility of the list view field.
Sets the number of items to display per page for the given list view.
The IsVisible
method is passed a ActionVisibilityContext
which you should use to decide whether the action should display, returning true
if it should, or false
if it should not. For more information check the .
Overriding an actions visibility is controlled via the configuration.
Count cards allow you to define cards directly against the configuration, providing a basic where clause to use in a count SQL statement. These work perfectly for basic data visualizations based on counts of entities in a collection.
If you need to do more than a basic count, you'll want to take a look at the documentation.
Umbraco UI Builder uses the same and so uses the same registration process. First you will need to define a notification event handler for the event you wish to handle like below:
The entity picker property editor comes with a built-in . This means that whenever you retrieve the property value from Umbraco it will return the actual selected entities, even converting them to the relevant type.
The list view configuration is a sub-configuration of a config builder instance and is accessed via its ListView
method.
With field views, you can customize the markup the list view's field so you can show richer visualizations of the field's content. For more information you can check the .
A list of useful Umbraco aliases for use with Umbraco UI Builder, the backoffice UI builder for Umbraco.
In a number of places in the Umbraco UI Builder API, you are required to know the aliases of other elements. For example, when you are adding sections, context apps, or dashboards before/after other instances. This is basic enough when it's referencing aliases of things defined in the Umbraco UI Builder config. However, for existing Umbraco instances it can be hard to find them so below is documented a number of known aliases for different elements.
Getting Started
contentIntro
Redirect URL Management
contentRedirectManager
Content
mediaFolderBrowser
Welcome
settingsWelcome
Examine Management
settingsExamine
Published Status
settingsPublishedStatus
Models Builder
settingsModelsBuilder
Health Check
settingsHealthCheck
Getting Started
memberIntro
Content
umbContent
Info
umbInfo
Content
umbContent
Info
umbInfo
Content
umbContent
Info
umbInfo
Design
design
List View
listView
Permissions
permissions
Templates
templates
Content
content
Media
media
Settings
settings
Packages
packages
Users
users
Members
member
Forms
forms
Translation
translation
Content
content
Media
media
Members
member
Member Groups
memberGroups
Configuring virtual sub trees in Umbraco UI Builder, the backoffice UI builder for 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.
Virtual subtrees are a powerful feature that allows you to inject an Umbraco UI Builder tree structure into another Umbraco tree at a desired location. Thus acting as child nodes to the node chosen as the injection point. With virtual subtrees it allows you to extend built in or even 3rd party package trees with additional features. An example could be developing a "loyalty point" program for your e-commerce site and injecting the related database tables into a Vendr store tree. This allows the management of the program in its most logical location.
You define a virtual subtree by calling one of the AddVirtualSubTree
methods of a WithTreeConfigBuilder
instance.
Adds a virtual subtree to the current tree with its visibility controlled via the visibility expression.
Adds a virtual subtree to the current tree, before the tree node matches the match expression, with its visibility controlled via the visibility expression.
Adds a virtual subtree to the current tree, after the tree node matches the match expression, with its visibility controlled via the visibility expression.
Controlling where a virtual subtree is injected is done via the visibility expression passed to one of the AddVirtualSubTree
methods on the root UIBuilderConfigBuilder
instance. Without a visibility expression, Umbraco UI Builder would inject the virtual subtree under every node in the given tree. This expression can be used to identify the exact location where our tree should go.
To help with this, the visibility expression is passed a single VirtualSubTreeFilterContext
argument with relevant contextual information. This information is about the current node being rendered, alongside a list of the current user's user groups for permission-based visibility control. It also includes access to an IServiceProvider
in case you need to resolve a service to determine the correct node to inject below.
Below you can find an example of a more complex filter expression where injection is based on the Document Type of a content node:
The position of a virtual subtree within the child nodes of the injection node is controlled by using one of the AddVirtualSubTreeBefore
or AddVirtualSubTreeAfter
methods. These methods need to be on the root level UIBuilderConfigBuilder
instance and pass a match expression used to identify the tree node to insert before/after. This expression is passed a single TreeNode
argument to determine the position. It also requires a boolean
return value to indicate the relevant location has been found.
Below you can find an example of positioning a subtree after a node with the alias "settings":
Virtual subtrees share the same API as the Tree
config builder API including support for folders and collections. There is an exception when adding collections to a subtree where you will have an additional foreign key expression parameter to define. The foreign key expression links the entities of the collection to the parent node of the subtree. For more information check the Core Trees Documentation.
Out of the box, Umbraco UI Builder supports injecting subtrees into the core content, media, members, and member group trees. It also includes 3rd party support for Umbraco Commerce settings and commerce trees. In order to support additional trees to inject into, you must implement an ITreeHelper
which is used to extract the required information. The tree helper consists of a tree alias for which the tree helper is. It includes methods to correctly identify the full parent path, a unique ID for a given node ID, and to resolve the actual entity ID. The entity ID should be used for the foreign key collection values.
Once you have defined a tree helper, you can register the DI container in your startup class.
Once registered any virtual subtrees registered against the given helpers tree alias will then use your tree helper to locate the required information.