Only this pageAll pages
Powered by GitBook
1 of 64

16.latest

Loading...

Loading...

Loading...

Getting Started

Loading...

Loading...

Loading...

Loading...

Loading...

Upgrading

Loading...

Loading...

Loading...

How-to Guides

Loading...

Areas

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Collections

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Searching

Loading...

Loading...

Filtering

Loading...

Loading...

Loading...

Loading...

Loading...

Actions

Loading...

Loading...

Loading...

Loading...

Cards

Loading...

Loading...

Loading...

Property Editors

Loading...

Loading...

Advanced

Loading...

Loading...

Loading...

Loading...

Loading...

Miscellaneous

Loading...

Loading...

Known Issues

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.

Property Editors

Tags

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 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.

Umbraco UI Builder Documentation

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.

Example Umbraco UI Builder UI

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.

Using The Documentation

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.

Getting Help

If you need assistance, refer to our support channels for help and troubleshooting.

Overview

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.

Search

Get started by reviewing how to define searchable properties.

Configuration

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.

Option 1: Configuring via a Composer

A Composer is a common approach for registering and configuring services in Umbraco during application startup.

To configure Umbraco UI Builder via a Composer:

  1. Create a file called UIBuilderComposer.cs in your project.

  2. Implement the IComposer interface and add the configuration inside the Compose method:

Option 2: Configuring via Program.cs

You can also configure Umbraco UI Builder directly in Program.cs using the AddUIBuilder extension method.

To configure Umbraco UI Builder:

  1. Open the Program.cs file in your project.

  2. Locate the CreateUmbracoBuilder() method.

  3. Add AddUIBuilder before AddComposers().

Example Configuration

For a complete sample configuration, see the article.

The AddUIBuilder method accepts a delegate function, allowing you to configure your solution using fluent APIs.

Overview

Available property editors in Umbraco UI Builder for managing data in Umbraco content nodes.

Umbraco UI Builder provides property editors for managing data inside Umbraco content nodes.

The available property editors are:

using Umbraco.Cms.Core.Composing;
using Umbraco.UIBuilder.Extensions;

public class UIBuilderComposer : IComposer
{
   public void Compose(IUmbracoBuilder builder)
    {
       builder.AddUIBuilder(cfg =>
        {
           // Apply your configuration here
        });
    }
}
builder.CreateUmbracoBuilder()
    .AddBackOffice()
    .AddWebsite()
    .AddUIBuilder(cfg => {
       // Apply your configuration here
    })
    .AddDeliveryApi()
    .AddComposers()
    .Build();
Creating your First Integration
Searchable Properties

Upgrading Umbraco UI Builder

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.

Get the latest version of Umbraco UI Builder

To get the latest version of Umbraco UI Builder, you can upgrade using either of the two options:

  • NuGet

  • Visual Studio

NuGet

  • To install the latest version via NuGet:

dotnet add package Umbraco.UIBuilder
  • To specify a package version:

dotnet add package Umbraco.UIBuilder --version <VERSION>
  • After adding the package reference, restore dependencies:

dotnet restore

Visual Studio

  1. Open Visual Studio.

  2. Navigate to Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution....

  3. Select Umbraco.UIBuilder.

  4. Choose the latest version from the drop-down and click Install.

  5. After installation, verify the update in your .csproj file:

<ItemGroup>
  <PackageReference Include="Umbraco.UIBuilder" Version="xx.x.x" />
</ItemGroup>

Upgrade Sub-Packages

If you are using any of the following sub-packages, upgrade them as well:

Sub-package
Description

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

Version Specific Upgrade Notes

Version specific documentation for upgrading to major versions of Umbraco UI Builder.

This article provides upgrade instructions for major versions of Umbraco UI Builder.

For minor or patch upgrades, check the Release Notes for breaking changes.

Upgrade to Version 14

Version 14 introduces breaking changes from the previous Konstrukt product. For full migration details, see the Migrate from Konstrukt to Umbraco UI Builder article.

Legacy Version Upgrade Notes

For out-of-support versions, see the Legacy documentation on GitHub.

Encrypted Properties

Configuring and using encrypted properties in Umbraco UI Builder to securely store sensitive data.

Umbraco UI Builder allows encrypting properties to store sensitive information securely. When a property is marked as encrypted, its value is automatically encrypted before storage and decrypted upon retrieval.

Umbraco UI Builder uses the IDataProtectionProvider instance registered in the DI container for encryption and decryption. To modify the encryption algorithm, replace the IDataProtectionProvider instance in the DI container.

Defining Encrypted Properties

Using the AddEncryptedProperty() Method

Encrypts the specified property. The property must be of type String. The value is encrypted before storage and decrypted when retrieved.

Method Syntax

AddEncryptedProperty(Lambda encryptedPropertyExpression) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.AddEncryptedProperty(p => p.Secret);

Field Views

Configuring Field Views in Umbraco UI Builder.

Field Views allow customization of the markup used by a field when displayed in a list view. Field Views are implemented as .NET Core View Components, which are passed a FieldViewsContext argument containing information about the entity/field being rendered.

Defining a Field View

You can define a field view in one of two ways:

Basic View File for the Built-In FieldView View Component

For field views, place a view file in the /Views/Shared/Components/FieldView folder with the following markup.

@model Umbraco.UIBuilder.Web.Models.FieldViewContext
<!-- Insert your markup here -->

WTo register the view, pass the name of the view file (excluding the .cshtml file extension) to the relevant API method.

Custom View Component

For more complex field views, create a custom view component class that can use dependency injection for any required dependencies. Use the following signature:

// Example
public class MyComplexFieldViewViewComponent : ViewComponent
{
    public async Task<IViewComponentResult> InvokeAsync(FieldViewContext context)
    {
        // Do your custom logic here

        return View("Default", model);
    }
}

The FieldViewContext parameter in the InvokeAsync method must be named context.

For the view component, place a Default.cshtml file into the /Views/Shared/Components/MyComplexFieldView folder with the following markup:

@model Namespace.Of.Model.Returned.By.Custom.ViewComponent
<!-- Insert your markup here -->

The Field View Context

Field view components are passed a FieldViewContext object with the following properties:

public class FieldViewContext
{
    public string ViewName { get; set; }
    public object Entity { get; set; }
    public string PropertyName { get; set; }
    public object PropertyValue { get; set; }
}

Setting the Field View of a List View Field

A field view is assigned to a list view field as part of the list view configuration. For more information, see the List Views article.

Global Filters

Learn how to configure a global filter in Umbraco UI Builder.

Use global filters to work with a specific subset of data within a collection. These filters apply to all queries for a given collection.

Applying a Global Filter

Configure global filters in the Collections settings.

Using the SetFilter() Method

Defines a filter using a where clause expression. The expression must return a boolean value.

Method Syntax

SetFilter(Lambda whereClauseExpression) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.SetFilter(p => p.Current);

Inbuilt Actions

A list of inbuilt actions that come with Umbraco UI Builder.

Umbraco UI Builder provides different inbuilt actions that you can use right away.

ExportEntityAction

Namespace: Umbraco.UIBuilder.Infrastructure.Configuration.Actions

Exports entity data to a Comma-Separated Values (CSV) file. It converts all properties into column headings and renders each entity's property values in rows.

ImportEntityAction

Namespace: Umbraco.UIBuilder.Infrastructure.Configuration.Actions

Imports data from a Comma-Separated Values (CSV) file. This action matches column headings with entity properties and maps row values to an entity.

Conventions

Guidelines for fluent configuration and naming conventions in Umbraco UI Builder.

Fluent Conventions

Umbraco UI Builder follows a fluent configuration style, allowing method chaining for concise and readable code. Alternatively, a lambda expression can be used for a more structured approach.

Chaining Example

config.AddSection("Repositories")
      .Tree()
      .AddCollection<People>(p => p.Id, "Person", "People");

Lambda Expression Example Example

config.AddSection("Repositories", sectionConfig => {  
    sectionConfig.Tree(treeConfig => {  
        treeConfig.AddCollection<People>(p => p.Id, "Person", "People");  
    });  
});

Naming Conventions

  • Methods prefixed with Add allow multiple configurations.

  • Methods prefixed with Set permit only one instance within the current configuration context.

Entity Picker

Summary Dashboards

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.

Summary Dashboard

Displaying a Collection on the Summary Dashboard

To display a collection on the summary dashboard, use the ShowOnSummaryDashboard() method in the collection configuration.

Configuration Example

collectionConfig.ShowOnSummaryDashboard();

Code Reference: ShowOnSummaryDashboard() : CollectionConfigBuilder<TEntityType>

Only root-level collections within a section can be displayed on the summary dashboard.

Overview

Configuring collection in Umbraco UI Builder to manage entity groups and define their UI integration.

A collection in Umbraco UI Builder represents a group of entities for a specific data model. It serves as the primary configuration object for defining how the collection integrates into the UI.

You can configure its list view appearance and editing options.

A collection list view

Get started by reviewing the basics of collection configuration.

Overview

Learn how to configure cards in Umbraco UI Builder.

Cards provide an API to display summary information in a card-based format, which is useful for displaying key metrics about a collection.

Cards

Cards can be defined in two ways:

Child Collections

Configuring child collections in Umbraco UI Builder.

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 is a container for data models that are tied to a parent collection. The child collection system shares the Collections API, offering flexibility for managing and displaying related data within your backoffice UI.

Child Collections

By default, child collections are displayed as context apps within the parent model's editor view. If multiple child collections lead to an overcrowded context apps area, consider using the Child Collection Groups API. Using the API, you can group related child collections under a single context app, with each child collection appearing in separate tabs.

Defining a Child Collection

To define a child collection, use the AddChildCollection method on the given collection config builder instance.

Using the AddChildCollection() Method

This method adds a child collection with the specified names, description, and default icons. Both the entity ID and foreign key fields must be specified using property accessor expressions.

Method Syntax

AddChildCollection<TChildEntityType>(Lambda idFieldExpression, Lambda fkFieldExpression, string nameSingular, string namePlural, string description, Lambda childCollectionConfig = null) : ChildCollectionConfigBuilder<TEntityType>

Example

collectionConfig.AddChildCollection<Child>(c => c.Id, c => c.ParentId, "Child", "Children", "A collection of children", childCollectionConfig => {
    ...
});

Using the AddChildCollection() Method with Custom Icons

This method adds a child collection to the current collection with the specified names, description and custom icons. Both the entity ID and foreign key fields must be specified using property accessor expressions.

Method Syntax

AddChildCollection<TChildEntityType>(Lambda idFieldExpression, Lambda fkFieldExpression, string nameSingular, string namePlural, string description, string iconSingular, string iconPlural, Lambda childCollectionConfig = null) : ChildCollectionConfigBuilder<TEntityType>

Example

collectionConfig.AddChildCollection<Child>(c => c.Id, c => c.ParentId, "Child", "Children", "A collection of children", "icon-umb-users", "icon-umb-users", childCollectionConfig => {
    ...
});

Configuring a Child Collection

Child collections share the same API as the Collection config builder API, except child collections cannot contain further child collections. For more information, see the Basics article.

Data Views

Learn how to configure data views in Umbraco UI Builder.

Data views allow you to define multiple pre-filtered views of the same data source. This is useful when entities exist in different states and you need a way to toggle between them.

Data Views

Defining Data Views

Data views are defined via the Collections settings.

Using the AddDataView() Method

Creates a data view with the specified name and a where clause filter expression. The expression must return a boolean value.

Method Syntax

AddDataView(string name, Lambda whereClauseExpression) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.AddDataView("Active", p => p.IsActive);

Using the AddDataView() Method with Group

Creates a data view within a specified group, using a where clause filter expression. The expression must return a boolean value.

Method Syntax

AddDataView(string group, string name, Lambda whereClauseExpression) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.AddDataView("Status", "Active", p => p.IsActive);

Using the AddAllDataView Method

Enables the All option for data views in the collection. The method can take an empty string, which will display the CMS localized All value, plain text, or a localized string.

Method Synthax

collectionConfig.AddAllDataView(string? label)

Overview

Learn how to configure filtering in Umbraco UI Builder.

In addition to Searching, you may need to create specific views of a collection's data. Umbraco UI Builder provides multiple filtering mechanisms to help with this.

Filterable Properties

Choose a filtering method from the list below to find out more.

Folders

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 .

Defining a Folder

To define a folder, use one of the AddFolder methods on a or parent Folder config builder instance.

Using the AddFolder() Method

Adds a folder to the current tree with the specified name and a default folder icon.

Method Syntax

Example

Using the AddFolder() Method with Custom Icon

Adds a folder to the current tree with a specified name and icon.

Method Syntax

Example

Changing a Folder Alias

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.

Using the SetAlias() Method

Sets a custom alias for a folder.

Method Syntax

Example

Changing a Folder Icon Color

Using the SetIconColor() Method

Sets the folder icon color to the given color. The available colors are: black, green, yellow, orange, blue, or red.

Method Syntax

Example

Adding a Sub-Folder To a Folder

Using the AddFolder() Method for Sub-Folders

Adds a sub-folder inside the current folder with a specified name and a default folder icon.

Method Syntax

Example

Using the AddFolder() Method for Sub-Folders with Custom Icon

Adds a sub folder to the current folder with a specified name and custom icon.

Method Syntax

Example

Adding a Collection to a Folder

Using the AddCollection<>() Method

Adds 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 article.

Method Syntax

Example

Using the AddCollection<>() Method with Custom Icons

Adds a collection to the current folder with the given names, description and icons. The ID property must be defined. For more details, see the article.

Method Syntax

Example

Installing Umbraco UI Builder

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.

Install via Command Line

Run the following command in your web project:

For a class library without UI elements, install:

Install via Visual Studio

To install via Visual Studio, follow these steps:

  1. Open Visual Studio and load your project.

  2. Go to Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution...

  3. Select the Browse tab and search for Umbraco.UIBuilder.

  1. Select a version from the Version drop-down based on the Umbraco CMS version you are using.

  2. Click Install.

  3. [Optional] Search for and install Umbraco.UIBuilder.Startup if installing without UI elements.

  4. Ensure that the package reference is added to the .csproj file once the installation is complete:

Installing a License

For details on how to install a license, see the article.

Entity Identifier Converters

Using Umbraco entities as reference with an UI Builder collection

Umbraco stores identifiers in UDI format for most Umbraco object types.

You can read more about them in the section of the documentation.

If you want to reference an Umbraco object in your model and retrieve its Integer or Guid value, you must convert the UDI value.

Use one of UI Builder's converters - EntityIdentifierToIntTypeConverter or EntityIdentifierToGuidTypeConverter. Add it as a [TypeConverterAttribute] to your model's foreign key property.

An entity that references an Umbraco object would look like this:

You can also create a custom type converter. UI Builder will handle data persistence automatically.

Overview

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.

Key Areas for Integration

  • : The Sections area allows you to organize your content in a structured layout, enabling users to navigate different parts of the backoffice.

  • : The Dashboards area is ideal for creating custom views that provide quick access to key information and statistics.

  • : 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.

Overview

Learn how to configure actions in Umbraco UI Builder.

Actions allow you to perform custom tasks on collections and their entities from different areas in the UI. For Example: menu actions, bulk actions, or individual table row actions.

To get started with actions, check out the basics:

Child Collection Groups

Configuring child collection groups in Umbraco UI Builder.

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.

Defining a Child Collection Group

You can define a child collection group by calling one of the AddChildCollectionGroup methods on a given collection config builder instance.

Using the AddChildCollectionGroup() Method

Adds a child collection group to the current collection with the specified name and default icon.

Method Syntax

Example

Using the AddChildCollectionGroup() Method with Custom Icon

Adds a child collection group to the current collection with the specified name and custom icon.

Method Syntax

Example

Requirements

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.

Prerequisites

  • Umbraco 15+ website configured and ready to install Umbraco UI Builder.

For instructions on installing Umbraco, see the .

System Requirements

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)

Versioning

Umbraco UI Builder is an add-on product for Umbraco CMS, and follows the .

User Interface

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.

Section

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.

Tree

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.

Dashboard

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.

Collection

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.

Editor

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

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 Workspace View might allow you to resize or crop an image directly from the editor.

Tabs

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.

Menu Item

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 Action

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.

Entity Picker

Configure and use the Entity Picker property editor in Umbraco UI Builder to select entities from a collection.

The Entity Picker property editor allows selecting one or more entities from an Umbraco UI Builder collection.

Configuring an Entity Picker

To configure an entity picker, follow these steps:

  1. Go to the Settings section in the Umbraco backoffice.

  2. Create a New Data Type.

  3. Select UI Builder Entity Picker from the Property Editor field.

  1. Enter a Name for the picker and click Save.

  2. Select the Section the collection is located in.

  3. Select the Collection to pick the entities from.

  4. [Optional] Select a list view Data View, if configured.

  5. Enter a Minimum number of items and Maximum number of items that can be selected.

  6. Click Save.

After defining the entity picker Data Type, add it to the desired Document Type.

Using an Entity Picker

The entity picker functions similarly to the content picker.

To pick an entity, follow these steps:

  1. Go to the Document Type where the entity picker Data Type is added.

  2. Click Add to open the picker dialog, displaying a paginated list of entities.

  3. [Optional] If searchable fields are configured, use the search input field to filter results.

  1. Click on the entity names.

  2. Click Submit. The picker displays a summary of selected entities, which can be reordered by dragging them.

  3. Click Save or Save and publish to save the changes.

Retrieving the Value of an Entity Picker

The entity picker property editor includes a built-in . Retrieving the property value from Umbraco returns the selected entities, converting them to the relevant type.

Filterable Properties

Learn how to configure filterable properties in Umbraco UI Builder.

Umbraco UI Builder dynamically constructs a filter dialog by choosing appropriate editor views based on basic property configurations. Properties of numeric or date types become range pickers, enums become select/checkbox lists, and other properties are text input filters.

Defining Filterable Properties

Defining filterable properties is controlled via the settings.

Using the AddFilterableProperty() Method

Adds a given property to the filterable properties collection.

Method Syntax

Example

Changing the Label of a Filterable Property

Using the SetLabel() Method

Sets the label for the filterable property.

Method Syntax

Example

Adding a Description to a Filterable Property

Using the SetDescription() Method

Sets a description for the filterable property.

Method Syntax

Example

Defining Basic Options for a Filterable Property

Using the SetOptions() Method

Defines basic options for a filterable property.

Method Syntax

Example

Defining Options with Custom Compare Clauses for a Filterable Property

Using the AddOption() Method

Defines options with custom comparison clauses for a filterable property.

Method Syntax

Example

Configuring the Mode of a Filterable Property

For filterable properties with options, you can configure whether the options should allow multiple or single selections.

Using the SetMode() Method

Configures the mode of a filterable property (multiple or single choice).

Method Syntax

Example

    [TableName(TableName)]
    [PrimaryKey("Id")]
    public class MemberReview
    {
        public const string TableName = "MemberReview";

        [PrimaryKeyColumn]
        public int Id { get; set; }

        public string Title { get; set; }

        public string Content { get; set; }

        [TypeConverter(typeof(EntityIdentifierToIntTypeConverter))]
        public int MemberId { get; set; }
    }
UDI Identifiers
Sections
Dashboards
Context Apps
Umbraco CMS Documentation
versioning strategy laid out for Umbraco CMS
AddFolder(string name, Lambda folderConfig = null) : FolderConfigBuilder
treeConfig.AddFolder("Settings", folderConfig => {
    ...
});
AddFolder(string name, string icon, Lambda folderConfig = null) : FolderConfigBuilder
treeConfig.AddFolder("Settings", "icon-settings", folderConfig => {
    ...
});
SetAlias(string alias) : FolderConfigBuilder
folderConfig.SetAlias("settings");
SetIconColor(string color) : FolderConfigBuilder
folderConfig.SetIconColor("blue");
AddFolder (string name, Lambda folderConfig = null) : FolderConfigBuilder
folderConfig.AddFolder("Categories", subFolderConfig => {
    ...
});
AddFolder (string name, string icon, Lambda folderConfig = null) : FolderConfigBuilder
folderConfig.AddFolder("Categories", "icon-tags", subFolderConfig => {
    ...
});
AddCollection<TEntityType>(
    Lambda idFieldExpression, 
    string nameSingular, 
    string namePlural, 
    string description, 
    Lambda collectionConfig = null
) : CollectionConfigBuilder<TEntityType>
folderConfig.AddCollection<Person>(
    p => p.Id, 
    "Person", 
    "People", 
    "A collection of people", 
    collectionConfig => {
        ...
    }
);
AddCollection<TEntityType>(
    Lambda idFieldExpression, 
    string nameSingular, 
    string namePlural, 
    string description, 
    string iconSingular, 
    string iconPlural, 
    Lambda collectionConfig = null
) : CollectionConfigBuilder<TEntityType>
folderConfig.AddCollection<Person>(
    p => p.Id, 
    "Person", 
    "People", 
    "A collection of people", 
    "icon-umb-users", 
    "icon-umb-users", 
    collectionConfig => {
        ...
    }
);
Collections
Tree
Collections
Collections
Tree with Settings folder
dotnet add package Umbraco.UIBuilder
dotnet add package Umbraco.UIBuilder.Startup
<ItemGroup>
<PackageReference Include="Umbraco.UIBuilder" Version="15.0.2" />
</ItemGroup>
Licensing
Installing Umbraco UI Builder via Visual Studio
AddChildCollectionGroup(string name, Lambda childCollectionGroupConfig = null) : ChildCollectionGroupConfigBuilder
collectionConfig.AddChildCollectionGroup("Family", childCollectionGroupConfig => {
    ...
});
AddChildCollectionGroup(string name, string icon, Lambda childCollectionGroupConfig = null) : ChildCollectionGroupConfigBuilder
collectionConfig.AddChildCollectionGroup("Family", "icon-users", childCollectionGroupConfig => {
    ...
});
Child Collection Groups
Section View
Tree View
Dashboard View
Collection View
Editor
Workspace Views
Tabs
Menu Item
Bulk Action
// Example
foreach(var p in Model.People){
    ...
}
value converter
Data Type config
Document Type config
Entity picker dialog
Entity picker values
AddFilterableProperty(Lambda filterablePropertyExpression, Lambda filterConfig = null) : CollectionConfigBuilder<TEntityType>
collectionConfig.AddFilterableProperty(p => p.FirstName, filterConfig => filterConfig 
    // ...
);
SetLabel(string label) : FilterablePropertyConfigBuilder<TEntityType, TValueType>
filterConfig.SetLabel("First Name");
SetDescription(string description) : FilterablePropertyConfigBuilder<TEntityType, TValueType>
filterConfig.SetDescription("The first name of the person");
SetOptions(IDictionary<TValueType, string> options) : FilterablePropertyConfigBuilder<TEntityType, TValueType>
filterConfig.SetOptions(new Dictionary<string, string> {
    { "Option1", "Option One" },
    { "Option2", "Option Two" }
});
AddOption(object key, string label, Lambda compareExpression) : FilterablePropertyConfigBuilder<TEntityType, TValueType>
filterConfig.AddOption("Option1", "Option One", (val) => val != "Option Two");
SetMode(FilterMode mode) : FilterablePropertyConfigBuilder<TEntityType, TValueType>
filterConfig.SetMode(FilterMode.MultipleChoice);
Collections
Filterable Properties
The Basics
Count Cards
Custom Cards
Global Filters
Data Views
Filterable Properties

Data Views Builders

Learn how to configure data views builders in Umbraco UI Builder.

Data views builders allow you to create a collection’s data views dynamically at runtime. By default, Umbraco UI Builder uses hard-coded data views from the configuration. However, if you need to generate data views dynamically, a data views builder is required.

When resolving a data views builder, Umbraco UI Builder first attempts to retrieve it from the global Dependency Injection (DI) container. This allows injecting required dependencies into the builder. If no type is defined in the DI container, Umbraco UI Builder falls back to manually instantiating a new instance of the value mapper.

Defining a Data Views Builder

To define a data views builder, create a class that inherits from DataViewsBuilder<TEntityType> and implements the required abstract methods.

// Example
public class PersonDataViewsBuilder : DataViewsBuilder<Person>
{
    public override IEnumerable<DataViewSummary> GetDataViews()
    {
        // Generate and return a list of data views
    }

    public override Expression<Func<Person, bool>> GetDataViewWhereClause(string dataViewAlias)
    {
        // Return a where clause expression for the supplied data view alias
    }
}

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 the Data Views Builder of a Collection

Setting a data views builder is controlled via the Collections settings.

Using the SetDataViewsBuilder() Method

Sets the collection's data views builder, allowing you to define data views dynamically at runtime.

Method Syntax

SetDataViewsBuilder<TDataViewsBuilder>() : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.SetDataViewsBuilder<PersonDataViewsBuilder>();

Using the SetDataViewsBuilder(Type) Method

Sets the collection's data views builder, allowing you to define data views dynamically at runtime.

Method Syntax

SetDataViewsBuilder(Type dataViewsBuilderType) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.SetDataViewsBuilder(typeof(PersonDataViewsBuilder));

Using the SetDataViewsBuilder(DataViewsBuilder<TEntityType>) Method

Sets the collection's data views builder, allowing you to define data views dynamically at runtime.

Method Syntax

SetDataViewsBuilder(DataViewsBuilder<TEntityType> dataViewsBuilder) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.SetDataViewsBuilder(new PersonDataViewsBuilder());

Custom Cards

Learn how to configure custom cards in Umbraco UI Builder.

Custom cards enable more complex metric calculations and are defined by a class that implements the Card base class.

When Umbraco UI Builder resolves a card, it tries to do so from the global DI container. This means you can inject any dependencies required for the card's value calculation. If no type is found in the DI container, Umbraco UI Builder will fall back to manually instantiating a new instance of the value mapper.

Defining a Custom Card

To define a custom card, create a class that inherits from the base class Card and configure it in the constructor as shown below:

// Example
public class AvgPersonAgeCard : Card
{
    public override string Alias => "avgPersonAge";
    public override string Name => "Average Age";
    public override string Icon => "icon-calendar";
    public override string Color => "green";
    public override string Suffix => "yrs";
        
    public override object GetValue(object parentId = null)
    {
        // Perform value calculation logic
    }
}

Configuration Options

Option
Description
Required

Name

The name of the card.

Yes

Alias

A unique alias for the card.

Yes

GetValue(object parentId = null)

A method to retrieve the card's value.

Yes

Icon

An icon displaed in the card.

No

Color

The color of the card.

No

Suffix

The suffix displayed after the card value.

No

Adding a Custom Card to a Collection

Using the AddCard() Method

Adds a custom card of the specified type to the collection.

Method Syntax

AddCard() : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.AddCard<AvgPersonAgeCard>();

Using the AddCard(Type cardType) Method

Adds a custom card of the specified type to the collection, using the Type parameter to pass the card type dynamically.

Method Syntax

AddCard(Type cardType) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.AddCard(typeof(AvgPersonAgeCard));

Count Cards

Learn how to configure count cards in Umbraco UI Builder.

Count cards allow you to define cards directly against the Collection 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, see the Custom Cards article.

Adding a Count Card to a Collection

Count cards display basic summaries of key information that may be useful to the editor.

Using the AddCard() Method

Adds a count card with the specified name and a where clause filter expression. The filter expression must be a boolean value.

Method Syntax

AddCard(string name, Lambda whereClauseExpression, Lambda cardConfig = null) : CardConfigBuilder

Example

collectionConfig.AddCard("Older than 30", p => p.Age > 30, cardConfig => {
    ...
});

Using the AddCard() Method with Icon

Adds a count card with the specified name, an icon, and a where clause filter expression. The filter expression must be a boolean value.

Method Syntax

AddCard(string name, string icon, Lambda whereClauseExpression, Lambda cardConfig = null) : CardConfigBuilder

Example

collectionConfig.AddCard("Older than 30", "icon-umb-users", p => p.Age > 30, cardConfig => {
    ...
});

Change the Color of a Count Card

Using the SetColor() Method

Sets the color for the count card.

Method Syntax

SetColor(string color) : CardConfigBuilder

Example

cardConfig.SetColor("blue");

Add a Suffix to a Count Value

Using the SetSuffix() Method

Sets a suffix to be displayed alongside the card value.d

Method Syntax

SetSuffix(string suffix) : CardConfigBuilder

Example

cardConfig.SetSuffix("years");

Formatting the Value of a Count

Using the SetFormat() Method

Sets a custom format for the card's value.

Method Syntax

SetFormat(Lambda formatExpression) : CardConfigBuilder

Example

cardConfig.SetFormat((v) => $"{v}%");

Value Mappers

Configuring value mappers in Umbraco UI Builder to modify how data is stored and retrieved.

Value mappers in Umbraco UI Builder act as intermediaries between the editor UI and the database, allowing customization of stored field values. By default, Umbraco UI Builder saves data as it would be stored in Umbraco, but value mappers enable modifications.

When resolving a value mapper, Umbraco UI Builder first checks the global DI container. If no type is defined, it manually instantiates a new instance.

Defining a Value Mapper

To define a mapper, create a class that inherits from the base class ValueMapper and implements the EditorToModel and ModelToEditor methods.

Example

public class MyValueMapper : ValueMapper
{
    public override object EditorToModel(object input)
    {
        // Tweak the input and return mapped object
        ...
    }

    public override object ModelToEditor(object input)
    {
        // Tweak the input and return mapped object
        ...
    }    
}

Setting a Field Value Mapper

Value mappers are defined as part of a collection editor field configuration.

Using the SetValueMapper() Method

Set the value mapper for the current field.

Method Syntax

SetValueMapper<TMapperType>() : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.SetValueMapper<MyValueMapper>();

Using the SetValueMapper(Type mapperType) Method

Set the value mapper for the current field using a type reference.

Method Syntax

SetValueMapper(Type mapperType) : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.SetValueMapper(typeof(MyValueMapper));

Using the SetValueMapper(Mapper mapper) Method

Set the value mapper for the current field using an instance.

Method Syntax

SetValueMapper(Mapper mapper) : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.SetValueMapper(new MyValueMapper());

Retrieve Child Collections

Configuring one-to-many relationships in Umbraco UI Builder.

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 one-to-many relationships, a parent entity is associated with multiple entities from another collection. In Umbraco UI Builder, retrieving child collections from such relationships is supported through child repositories. This enables you to access related data effectively, helping to maintain a well-organized backoffice UI.

Models Representation

For a one-to-many relationship, you typically have two models: one for the parent entity and one for the child entity.

[TableName("Students")]
[PrimaryKey("Id")]
public class Student
{
    [PrimaryKeyColumn]
    public int Id { get; set; }

    public string FirstName { get; set; }

    public string LastName { get; set; }

    public string Email { get; set; }
}

In the above example, the Student model represents the parent entity. A student can have multiple associated StudentProjects.

[TableName("StudentProjects")]
[PrimaryKey("Id")]
public class StudentProject
{
    [PrimaryKeyColumn]
    public int Id { get; set; }

    public string Name { get; set; }

    public int StudentId { get; set; }
}

The StudentProjects model represents the child entity. The StudentId is a foreign key that links each StudentProject to the Student entity, establishing the one-to-many relationship.

Child Repositories

To retrieve data from child collections, you can use the IRepositoryFactory to create child repository instances. These repositories provide methods to fetch child entities associated with a given parent entity.

public class StudentProjectController : Controller
{
    private readonly IRepositoryFactory _repositoryFactory;

    public StudentProjectController(IRepositoryFactory repositoryFactory)
    {
        _repositoryFactory = repositoryFactory;
    }

    public IActionResult Index(int projectId)
    {
        var childRepository = _repositoryFactory.GetChildRepository<int, StudentProject, int>(projectId);

        var list = childRepository.GetAll();

        var count = childRepository.GetCount();

        var listPaged = childRepository.GetPaged();

        return View(list);
    }
}

In this example:

  • The StudentProjectController is using the IRepositoryFactory to create a child repository for StudentProject.

  • The GetAll()method retrieves all child entities related to the given parent.

  • The GetCount() method returns the total number of child entities associated with the parent.

  • The GetPaged() method allows for pagination of child entities, making it easier to manage large sets of data.

This structure allows efficient retrieval and management of child entities, providing a well-organized way to interact with related data in Umbraco's backoffice.

Release Notes

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.

Release History

Below are the release notes for Umbraco UI Builder, detailing all changes in this version.

16.0.0 (June 12th 2025)

  • Upgraded to run on Umbraco version 16.

Legacy Release Notes

You can find the release notes for Konstrukt in the Change log file on GitHub.

Bulk Actions UI
The Basics

List Views

Configuring the list view of a collection in Umbraco UI Builder.

A list view displays a collection entity in a list format and includes features like pagination, custom data views, searching, and bulk actions.

A collection list view

Configuring a List View

The list view configuration is a sub-configuration of a Collection config builder instance and can be accessed via the ListView method.

Using the ListView() Method

Accesses the list view configuration for the specified collection.

Method Syntax

ListView(Lambda listViewConfig = null) : ListViewConfigBuilder<TEntityType>

Example

collectionConfig.ListView(listViewConfig => {
    ...
});

Adding a Field to the List View

Using the AddField() Method

Adds a specified property to the list view.

Method Syntax

AddField(Lambda propertyExpression, Lambda fieldConfig = null) : ListViewFieldConfigBuilder<TEntityType, TValueType>

Example

listViewConfig.AddField(p => p.FirstName, fieldConfig => {
    ...
});

Changing the Heading of a Field

Using the SetHeading() Method

Sets the heading for a field in the list view.

Method Syntax

SetHeading(string heading) : ListViewFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.SetHeading("First Name");

Formatting the Value of a Field

Using the SetFormat() Method

Sets the format expression to the field in the list view.

Method Syntax

SetFormat(Lambda formatExpression) : ListViewFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.SetFormat((v, p) => $"{v} years old");

Setting the View of a Field

You can customize the field's markup with field views, allowing richer visualizations of the content. For more details, see the Field Views article.

Using the SetView() Method

Sets the view component for the list view field.

Method Syntax

SetView(string viewComponentName) : ListViewFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.SetView("ImageFieldView");

Using the SetView<TView>() Method

Sets the view component for the list view field.

Method Syntax

SetView<TView>() : ListViewFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.SetView<ImageFieldView>();

Setting the Visibility of a Field

Using the SetVisibility() Method

Controls the runtime visibility of a field in the list view.

Method Syntax

SetVisibility(Predicate<ListViewFieldVisibilityContext> visibilityExpression) : ListViewFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.SetVisibility(ctx => ctx.UserGroups.Any(x => x.Alias == "editor"));

Changing the Page Size

Using the SetPageSize Method

Sets the number of items per page for the list view.

Method Syntax

SetPageSize(int pageSize) : ListViewConfigBuilder<TEntityType>

Example

listViewConfig.SetPageSize(20);

Searchable Properties

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.

Search

Defining Searchable Properties

Using AddSearchableProperty() Method

Use AddSearchableProperty to specify which properties should be included in search functionality.

Method Syntax

AddSearchableProperty(Lambda searchablePropertyExpression) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.AddSearchableProperty(p => p.FirstName);
collectionConfig.AddSearchableProperty(p => p.Address.Street);

Search Expression Pattern

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.

Example

collectionConfig.AddSearchableProperty(p => p.FirstName); // will search for keywords that start with.
collectionConfig.AddSearchableProperty(p => p.FirstName, SearchExpressionPattern.Contains); // will search for keywords that are contained.

Dashboards

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.

Defining a Dashboard

You can define a dashboard by calling one of the AddDashboard methods on a or a instance.

Using the AddDashboard() Method

Adds a dashboard with the specified name.

Method Syntax

Example

Using the AddDashboardBefore() Method

Adds a dashboard with the specified name before the dashboard with the given alias.

Method Syntax

Example

Using the AddDashboardAfter() Method

Adds a dashboard with the specified name after the dashboard with the given alias.

Method Syntax

Example

Setting a Custom Dashboard Alias

Using the SetAlias() Method

Sets 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.

Method Syntax

Example

Controlling Dashboard Visibility

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.

Using the SetVisibility() Method

Defines visibility rules for the dashboard.

Method Syntax

Example

Assigning a Collection to a Dashboard

A dashboard can display only one collection. To display multiple collections, multiple dashboards must be configured.

Using the SetCollection<>() Method

Assigns a collection to the dashboard with the specified names, descriptions, and default icons. The ID property must be defined. For more details, see the article.

Method Syntax

Example

Using the SetCollection<>() Method with Custom Icons

Assigns a collection to the dashboard with the specified names, descriptions, and custom icons. The ID property must be defined. For more details, see the article.

Method Syntax

Example

Licensing

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.

How Licensing Works

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.

Example License Coverage

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.

What a License Covers?

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 to your license.

This is an add-on domain for existing licenses. Refunds will not be given for this product.

Configuring Your License

You can look at the pricing, features, and purchase a license on the 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.

Adding Additional Domains

If you require to add additional domains to the license, . They will manage your request and take care of the process.

Installing your license

Once you have received your license code it needs to be installed on your site.

  1. Open the root directory of your project files.

  2. Locate and open the appSettings.json file.

  3. 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.

Verifying the License

To verify that your license is successfully installed:

  1. Log into Umbraco Backoffice.

  2. Navigate to the Settings > License dashboard.

  3. Verify the license status displayed on the dashboard.

Validating a License Without an Internet connection

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.

Repositories

Configure repositories in Umbraco UI Builder.

Repositories in Umbraco UI Builder manage entity data storage. By default, collections use a built-in NPoco repository. To use a different storage strategy, define a custom repository implementation.

Defining a Repository

Create a class that inherits from Repository<TEntity, TId> and implements all abstract methods.

Impl methods have public alternatives without the suffix. Separate implementation methods ensure repositories trigger Umbraco UI Builder events, whether actions originate from the UI or not.

Changing the Repository Implementation of a Collection

Using the SetRepositoryType() Method

Assign a custom repository type to a collection.

Method Syntax

Example

Using the SetRepositoryType(Type repositoryType) Method

Sets the repository type dynamically to the given type for the current collection.

Method Syntax

Example

Accessing a Repository in Code

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.

Using the GetRepository<TEntity, TId>() Method

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.

Method Syntax

Example

Using the GetRepository<TEntity, TId>(string collectionAlias) Method

Creates a repository for the given entity type from the collection with the given alias.

Method Syntax

Example

Migrate from Konstrukt to Umbraco UI Builder

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.

Key Changes

Before starting, review these key changes that impact the migration process.

Project, Package, and Namespace changes

Konstrukt
Umbraco UI Builder

Code and UI Changes

C# Class Changes
  • Namespace changes as mentioned above.

  • Most Konstrukt-prefixed classes have had the prefix removed.

    • Examples: IKonstruktRepository -> IRepository

    • Exceptions:

      • KonstruktConfig and KonstruktConfigBuilder now use a UIBuilder prefix.

      • AddKonstrukt extension for IUmbracoBuilder is now AddUIBuilder

JavaScript Changes
  • All Konstrukt controllers are now under the Umbraco.UIBuilder namespace.

  • All Konstrukt prefixed directives, services, and resources now use uibuilder.

UI Changes
  • All static UI assets are now served via a Razor Compiled Library (RCL) instead of being stored in the App_Plugins folder.

  • The App_Plugins/Konstrukt folder is now App_Plugins/UmbracoUIBuilder.

Step 1: Replace Dependencies

Replace all existing Konstrukt dependencies with Umbraco UI Builder dependencies.

  1. Remove existing Konstrukt packages:

  1. Delete the Konstrukt App_Plugins folder:

  1. Install Umbraco.UIBuilder:

  1. Compile your project against .NET 7.0.

Step 2: Update Namespaces and Entity Names

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.

Step 3: Update Configuration

If your configuration is in a single statement, replace AddKonstrukt with AddUIBuilder.

For multi-step configurations using Action or Card classes, update the config builders and base classes to their UI Builder alternatives as described in .

Step 4: Finalize the Migration

  1. Delete obj/bin folders for a clean build.

  2. Recompile all projects and ensure all dependencies are restored correctly.

  3. Remove existing Konstrukt license files from umbraco\Licenses folder.

  4. Add your Umbraco.UIBuilder license key to the appSettings.json file:

  1. Run the project.

Events

Configuring event handlers in Umbraco UI Builder.

Umbraco UI Builder triggers different notification events during operation, allowing customization of default behavior.

Registering Event Handlers

Umbraco UI Builder follows the for event registration.

Define a notification event handler for the target event:

Register the event handler in Program.cs:

Repository Events

Using the EntitySavingNotification()

Triggers when Save is called before persisting the entity. The notification contains an Entity property with Before and After values, providing access to the previous and updated entities. Modify the After entity to persist changes. If the Cancel property of the notification is set to true then the save operation will be canceled and no changes will be saved.

Example

Using the EntitySavedNotification()

Triggers 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.

Example

Using the EntityDeletingNotification()

Triggers when the repository Delete method is called and before the entity is deleted. The notification contains an Entity property providing access to a copy of the entity about to be deleted. If the Cancel property of notification is set to true then the delete operation will be cancelled and entity won't be deleted.

Example

Using the EntityDeletedNotification()

Triggers 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.

Example

Using the SqlQueryBuildingNotification()

Triggers 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.

Example

Using the SqlQueryBuiltNotification()

Triggers 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.

Example

Repository Events Validation

From version 15.1.0, complex server-side validation can be added to a collection using the CancelOperation method of the notification.

Example

// Example
public class PersonRepository : Repository<Person, int> {

    public PersonRepository(RepositoryContext context)
        : base(context)
    { }

    protected override int GetIdImpl(Person entity) {
        return entity.Id;
    }

    protected override Person GetImpl(int id) {
        ...
    }

    protected override Person SaveImpl(Person entity) {
        ...
    }

    protected override void DeleteImpl(int id) {
        ...
    }

    protected override IEnumerable<Person> GetAllImpl(Expression<Func<Person, bool>> whereClause, Expression<Func<Person, object>> orderBy, SortDirection orderByDirection) {
        ...
    }

    protected override PagedResult<Person> GetPagedImpl(int pageNumber, int pageSize, Expression<Func<Person, bool>> whereClause, Expression<Func<Person, object>> orderBy, SortDirection orderByDirection) {
        ...
    }

    protected override long GetCountImpl(Expression<Func<Person, bool>> whereClause) {
        ...
    }

    protected override IEnumerable<TJunctionEntity> GetRelationsByParentIdImpl<TJunctionEntity>(int parentId, string relationAlias)
    {
        ...
    }

    protected override TJunctionEntity SaveRelationImpl<TJunctionEntity>(TJunctionEntity entity)
    {
        ...
    }
}
SetRepositoryType<TRepositoryType>() : CollectionConfigBuilder<TEntityType>
collectionConfig.SetRepositoryType<PersonRepositoryType>();
SetRepositoryType(Type repositoryType) : CollectionConfigBuilder<TEntityType>
collectionConfig.SetRepositoryType(typeof(PersonRepositoryType));
IRepositoryFactory.GetRepository<TEntity, TId>() : Repository<TEntity, TId>
public class MyController : Controller
{
    private readonly Repository<Person, int> _repo;

    public MyController(IRepositoryFactory repoFactory) 
    {
        _repo = repoFactory.GetRepository<Person, int>();
    }
}
IRepositoryFactory.GetRepository<TEntity, TId>(string collectionAlias) : Repository<TEntity, TId>
public class MyController : Controller
{
    private readonly Repository<Person, int> _repo;

    public MyController(IRepositoryFactory repoFactory) 
    {
        _repo = repoFactory.GetRepository<Person, int>("person");
    }
}
"Umbraco": {
    "Licenses": {
        "Products": {
            "Umbraco.UIBuilder": "YOUR_LICENSE_KEY"
         }
  }
}
"Umbraco_UIBuilder": "YOUR_LICENSE_KEY"
  "Umbraco": {
    "Licenses": {
      "Umbraco.UIBuilder": "<your license key>"
    },
    "LicensesOptions": {
      "EnableScheduledValidation": false,
      "ValidatedLicenseRelayAuthKey": "<your authorization key>"
    }
POST https://license-validation.umbraco.com/api/ValidateLicense
{
    "ProductId": "Umbraco.UIBuilder",
    "LicenseKey": "<your license key>",
    "Domain": "<your licensed domain>"
}
POST http://<your umbraco environment>/umbraco/licenses/validatedLicense/relay?productId=<product id>&licenseKey=<license key>
add additional domains
Umbraco UI Builder
reach out to the sales team

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

dotnet remove package Konstrukt
rmdir App_Plugins\Konstrukt
dotnet add package Umbraco.UIBuilder
builder.CreateUmbracoBuilder()
    .AddBackOffice()
    .AddWebsite()
    .AddDeliveryApi()
    .AddComposers()
    .AddUIBuilder(cfg => {
        // The rest of your configuration
    })
    .Build();
"Umbraco": {
  "Licenses": {
    "Umbraco.UIBuilder": "YOUR_LICENSE_KEY"
  }
}
Key Changes
Key Changes
public class MyEntitySavingEventHandler :  INotificationHandler<EntitySavingNotification> {

    public void Handle(EntitySavingNotification notification)
    {
        // Handle the event here
    }

}
builder.CreateUmbracoBuilder()
    .AddBackOffice()
    .AddWebsite()
    .AddDeliveryApi()
    .AddComposers()
    .AddNotificationHandler<EntitySavingNotification, MyEntitySavingEventHandler>()
    .Build();
public class MyEntitySavingEventHandler :  INotificationHandler<EntitySavingNotification> {

    public void Handle(EntitySavingNotification notification)
    {
        var person = notification.Entity.After as Person;
        if (person != null){
            ...
        }
    }

}
public class MyEntitySavedEventHandler :  INotificationHandler<EntitySavedNotification> {

    public void Handle(EntitySavedNotification notification)
    {
        var person = notification.Entity.After as Person;
        if (person != null){
            ...
        }
    }

}
public class MyEntityDeletingEventHandler :  INotificationHandler<EntityDeletingNotification> {

    public void Handle(EntityDeletingNotification notification)
    {
        var person = notification.Entity.After as Person;
        if (person != null){
            ...
        }
    }

}
public class MyEntityDeletedEventHandler :  INotificationHandler<EntityDeletedNotification> {

    public void Handle(EntityDeletedNotification notification)
    {
        var person = notification.Entity.After as Person;
        if (person != null){
            ...
        }
    }

}
public class MySqlQueryBuildingEventHandler :  INotificationHandler<SqlQueryBuildingNotification> {

    public void Handle(SqlQueryBuildingNotification notification)
    {
        notification.Sql = notification.Sql.Append("WHERE MyId = @0", 1);
    }

}
public class MySqlQueryBuiltEventHandler :  INotificationHandler<SqlQueryBuiltNotification> {

    public void Handle(SqlQueryBuiltNotification notification)
    {
        notification.Sql = notification.Sql.Append("WHERE MyId = @0", 1);
    }

}
public class MyEntitySavingEventHandler :  INotificationHandler<EntitySavingNotification> {

    public void Handle(EntitySavingNotification notification)
    {
        var person = notification.Entity.After as Person;
        if (person != null && person.Age < 18) {
            notification.CancelOperation(new EventMessage("ValidationError", "Custom validation error message raised from the notification handler"));
        }
    }

}
Umbraco Notification mechanism
AddDashboard(string name, Lambda dashboardConfig = null) : DashboardConfigBuilder
sectionConfig.AddDashboard("Team", dashboardConfig => {
    ...
});
AddDashboardBefore(string beforeAlias, string name, Lambda dashboardConfig = null) : DashboardConfigBuilder
sectionConfig.AddDashboardBefore("contentIntro", "Team", dashboardConfig => {
    ...
});
AddDashboardAfter(string afterAlias, string name, Lambda dashboardConfig = null) : DashboardConfigBuilder
sectionConfig.AddDashboardAfter("contentIntro", "Team", dashboardConfig => {
    ...
});
SetAlias(string alias) : DashboardConfigBuilder
dashboardConfig.SetAlias("team");
SetVisibility(Lambda visibilityConfig) : DashboardConfigBuilder
dashboardConfig.SetVisibility(visibilityConfig => visibilityConfig
    .ShowForUserGroup("admin")
    .HideForUserGroup("translator")
);
SetCollection<TEntityType>(
    Lambda idFieldExpression, 
    string nameSingular, 
    string namePlural, 
    string description, 
    Lambda collectionConfig = null
) : ContextAppConfigBuilder
dashboardConfig.SetCollection<Comment>(
    p => p.Id, 
    "Team Member", 
    "Team Members", 
    "A collection of team members", 
    collectionConfig => {
        ...
    }
);
SetCollection<TEntityType>(
    Lambda idFieldExpression, 
    Lambda fkFieldExpression, 
    string nameSingular, 
    string namePlural, 
    string description, 
    string iconSingular, 
    string iconPlural, 
    Lambda collectionConfig = null
) : ContextAppConfigBuilder
dashboardConfig.SetCollection<Comment>(
    p => p.Id, 
    p => p.ForeignKey, 
    "Team Member", 
    "Team Members", 
    "A collection of team members", 
    "icon-umm-user", 
    "icon-umb-user", 
    collectionConfig => {
        ...
    }
);
SectionConfigBuilder
WithSectionConfigBuilder
Collections
Collections
Dashboards

Umbraco Aliases

Common Umbraco aliases used in Umbraco UI Builder for Sections, Dashboards, Workspace Views, and Trees.

Umbraco UI Builder requires aliases for different elements, such as sections, context apps, and dashboards. While aliases for elements defined in the UI Builder config are straightforward, finding aliases for existing Umbraco instances can be challenging. Below is a list of known aliases for reference.

Dashboard Aliases

Content

Name
Alias

Getting Started

contentIntro

Redirect URL Management

contentRedirectManager

Media

Name
Alias

Content

mediaFolderBrowser

Settings

Name
Alias

Welcome

settingsWelcome

Examine Management

settingsExamine

Published Status

settingsPublishedStatus

Models Builder

settingsModelsBuilder

Health Check

settingsHealthCheck

Members

Name
Alias

Getting Started

memberIntro

Workspace Views Aliases

Content

Name
Alias

Content

umbContent

Info

umbInfo

Media

Name
Alias

Content

umbContent

Info

umbInfo

Members

Name
Alias

Content

umbContent

Info

umbInfo

ContentTypes

Name
Alias

Design

design

List View

listView

Permissions

permissions

Templates

templates

Section Aliases

Name
Alias

Content

content

Media

media

Settings

settings

Packages

packages

Users

users

Members

member

Forms

forms

Translation

translation

Tree Aliases

Name
Alias

Content

content

Media

media

Members

member

Member Groups

memberGroups

The Basics

Configuring actions in Umbraco UI Builder.

Actions allow you to add custom functionality to Umbraco UI Builder without creating custom UI elements. By providing an action to run, Umbraco UI Builder can trigger actions from different UI locations.

Defining an Action

To define an action, create a class that inherits from the base class Action<> and configure it as shown below:

// Example
public class MyAction : Action<ActionResult>
{
    public override string Icon => "icon-settings";
    public override string Alias => "myaction";
    public override string Name => "My Action";
    public override bool ConfirmAction => true;

    public override ActionResult Execute(string collectionAlias, object[] entityIds)
    {
        // Perform operation here...
    }
}

Configuration Options

Option
Description
Required

Name

The name of the action.

Yes

Alias

A unique alias for the action.

Yes

Icon

An icon to display next to the action’s name.

Yes

Execute

The method that runs for the given list of entities.

Yes

ConfirmAction

Set whether a confirm dialog should display before performing this action.

No

The generic argument specifies the return type for the action. For more details, see the Controlling the Action Result section below.

You can use dependency injection to inject any services required for your specific task. It's recommended to inject Lazy<YourService> implementations of the required services to ensure they are resolved only when needed.

Controlling the Action Result

By default, actions return an ActionResult, but you can return other types by changing the Action<> generic argument.

  • ActionResult - Standard result with a boolean Success value.

  • FileActionResult - Returns a file stream or bytes and triggers a download dialog.

Capturing Settings for an Action

Sometimes, you need to collect user input before performing an action. You can achieve this by using the Action<> base class with an additional TSetting generic argument.

// Example
public class MyAction : Action<MyActionSettings, ActionResult>
{
    public override string Icon => "icon-settings";
    public override string Alias => "myaction";
    public override string Name => "My Action";
    public override bool ConfirmAction => true;

    public override void Configure(SettingsConfigBuilder<MyActionSettings> settingsConfig)
    {
        settingsConfig.AddFieldset("General", fieldsetConfig => fieldsetConfig
            .AddField(s => s.RecipientName).SetLabel("Recipient Name")
            .AddField(s => s.RecipientEmail).SetLabel("Recipient Email"));
    }

    public override ActionResult Execute(string collectionAlias, object[] entityIds, MyActionSettings settings)
    {
        // Perform operation here...
    }
}

public class MyActionSettings
{
    public string RecipientName { get; set; }
    public string RecipientEmail { get; set; }
}

By implementing this base class, you must also implement the Configure method which accepts a SettingsConfigBuilder<> parameter. Use this builder to define the settings dialog UI and how it maps to the settings type. You can create fieldsets and fields with the same fluent API as in the Collection Editors section.

Additionally, the Execute method now accepts an extra settings parameter, which Umbraco UI Builder will pre-populate with the user-entered values. You can adjust the action's behavior based on this data.

Adding an Action to a Collection

Actions are added via the Collections settings.

Using the AddAction<TMenuActionType>() Method

Adds an action of the specified type to the collection.

Method Syntax

AddAction<TMenuActionType>() : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.AddAction<ExportMenuAction>();

Using the AddAction(Type actionType) Method

Adds an action of the specified type to the collection.

Method Syntax

AddAction(Type actionType) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.AddAction(actionType);

Using the AddAction(IAction action) Method

Adds the given action to the collection.

Method Syntax

AddAction(IAction action) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.AddAction(action);

Action Visibility

Controlling the visibility of actions in Umbraco UI Builder.

By default, actions are hidden in the UI. You must define when and where an action should appear. This can be done either at the action definition level or when registering it in the collection config.

Controlling Default Action Visibility

To define the default visibility of an action, override the IsVisible method of the Action<> base class.

// Example
public class MyAction : Action<ActionResult>
{
    ...
    public override bool IsVisible(ActionVisibilityContext ctx)
    {
        return ctx.ActionType == ActionType.Bulk 
            || ctx.ActionType == ActionType.Row;
    }
    ...
}

The IsVisible method receives an ActionVisibilityContext. You can use this context to decide whether the action should be displayed. Return true to show it, or false to hide it. For more information, see the Action visibility context section below.

Overriding Action Visibility

You can override an action's visibility in the Collections settings.

Using the AddAction<TMenuActionType>() Method

Adds an action of the given type to the collection with the specified visibility.

Method Syntax

AddAction<TMenuActionType>(Lambda actionConfig = null) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.AddAction<ExportMenuAction>(actionConfig => actionConfig
    .SetVisibility(x => x.ActionType == ActionType.Bulk 
        || x.ActionType == ActionType.Row)
);

Using the AddAction(Type actionType, Lambda actionConfig = null) Method

Adds an action of the given type to the collection by specifying the action type dynamically using Type instead of a generic type.

Method Syntax

AddAction(Type actionType, Lambda actionConfig = null) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.AddAction(typeof(ExportMenuAction), actionConfig => actionConfig
    .SetVisibility(x => x.ActionType == ActionType.Bulk 
        || x.ActionType == ActionType.Row)
);

Using the AddAction(IAction action, Lambda actionConfig = null) Method

Adds the already defined action instance to the collection with the specified visibility.

Method Syntax

AddAction(IAction action, Lambda actionConfig = null) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.AddAction(action, actionConfig => actionConfig
    .SetVisibility(x => x.ActionType == ActionType.Bulk 
        || x.ActionType == ActionType.Row)
);

Action Visibility Context

When controlling the visibility of an action, you will receive an ActionVisibilityContext object. This context allows you to decide whether to show the action. The context contains two key pieces of information for this decision.

ActionType

The ActionType property is an enum property that defines which area of the UI wants to access the action. This property helps determine where the action is displayed.

ContainerMenu

The ContainerMenu action type displays the action in both the collection tree and its list view actions menu.

Container Menu

EntityMenu

The EntityMenu action type shows the action in the collection editor UI's actions menu.

Entity Menu

Bulk

The Bulk action type displays the action in the collection list view bulk actions menu.

Bulk Actions

Row

The Row action type shows the action in the collection list view action row menu.

Row Actions

Save

The Save action type displays the action as a sub-button in the entity editor’s save button. All Save actions trigger a save before executing. Their labels are prefixed with Save & [Action Name].

Save Actions

UserGroups

The UserGroups collection contains a list of IReadOnlyUserGroup objects for the current logged-in backoffice user. This allows you to control action visibility for members of specific user groups.

Sections

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.

Defining a Section

Sections are defined using the AddSection method on the root-level UIBuilderConfigBuilder instance.

Using the AddSection() Method

This method adds a new section to the Umbraco menu with the specified name, allowing custom areas for organizing content in the backoffice.

Method Syntax

Example

Using the AddSectionBefore() Method

This method adds a section before another section with the specified alias, allowing for customized ordering of sections in the backoffice.

Method Syntax

Example

Using the AddSectionAfter() Method

This method adds a section after another section with the specified alias, allowing for a custom order of sections in the backoffice.

Method Syntax

Example

Customizing the Section Alias

Setting a Custom Alias with SetAlias() Method

This 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.

Method Syntax

Example

Configuring the Section Tree

Using the Tree() Method for Configuration

This method configures the tree structure for the section, which is used to organize content types. For more information, see the article.

Method Syntax

Example

Adding Dashboards to the Section

Adding a Dashboard with the AddDashboard() Method

This method adds a dashboard to the section with the specified alias, providing tools and features for content management. For more information, see the article.

Method Syntax

Example

Using AddDashboardBefore() to Place a Dashboard

This method adds a dashboard before another dashboard with the specified alias, allowing custom placement in the section. For more information, see the article.

Method Syntax

Example

Using AddDashboardAfter() to Place a Dashboard

This method adds a dashboard after another dashboard with the specified alias, giving control over dashboard order. For more information, see the article.

Method Syntax

Example

Extending Existing Sections

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.

Extending an Existing Section with WithSection()

This method extends an existing section with additional configuration, enabling more customization for existing areas.

Method Syntax

Example

Adding Trees to an Existing Section

Using the AddTree() Method

This method adds a tree to the section, helping to visualize and organize content types. For more information, see the article.

Method Syntax

Example

Grouping Trees with AddTree() Method

This method adds a tree within a specified group, improving content organization by grouping related trees together. For more information, see the article.

Method Syntax

Example

Adding a Tree Before or After an Existing Tree

Using AddTreeBefore() to Position a Tree

This method adds a tree before another tree within the section, allowing you to customize the tree order. For more information, see the article.

Method Syntax

Example

Using AddTreeAfter() to Position a Tree

This method adds a tree after another tree within the section, enabling specific ordering of trees. For more information, see the article.

Method Syntax

Example

Adding a Dashboard to an Existing Section

Using the AddDashboard() Method

This method adds a new dashboard to the section with the specified name. For more information, see the article.

Method Syntax

Example

Using the AddDashboardBefore() Method

This method adds a dashboard before the dashboard with the specified alias. For more information, see the article.

Method Syntax

Example

Using the AddDashboardAfter() Method

This method adds a dashboard after the dashboard with the specified alias. For more information, see the article.

Method Syntax

Example

Virtual Sub Trees

Configuring virtual sub trees in Umbraco UI Builder.

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 inject an Umbraco UI Builder tree structure into another Umbraco tree at a specified location, acting as child nodes of the injection point. They extend built-in or third-party package trees with additional features. For example a "loyalty points" program for an e-commerce site can inject related database tables into a Commerce store tree, making management more intuitive.

Defining Virtual SubTrees

Use the AddVirtualSubTree methods of a instance to define a virtual subtree.

Using the AddVirtualSubTree() Method

Adds a virtual subtree to the current tree with visibility controlled by the specified expression.

Method Syntax

Example

Using the AddVirtualSubTreeBefore() Method

Adds a virtual subtree to the current tree before the tree node matches the match expression, with its visibility controlled by the specified expression.

Method Syntax

Example

Using the AddVirtualSubTreeAfter() Method

Adds a virtual subtree to the current tree after the tree node matches the match expression, with its visibility controlled by the specified expression.

Method Syntax

Example

Control the Virtual SubTrees Inject Location

Control the injection location by passing a visibility expression to the AddVirtualSubTree methods on the root UIBuilderConfigBuilder instance. Without a visibility expression, the subtree appears under every node in the target tree. This expression can be used to identify the exact location where the tree should go.

The visibility expression receives a VirtualSubTreeFilterContext argument with relevant contextual information. The information includes 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 for dependency resolution.

Example: Filter Injection by Document Type

Control the Position of the injected Virtual SubTrees

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. The match expression identifies the node for insertion. This expression passes 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":

Configuring a Virtual SubTree

Virtual subtrees use 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, see the article.

Inject Virtual Subtrees into Third-Party Trees

Out of the box, Umbraco UI Builder supports injecting subtrees into the core content, media, members, and member group trees. It also includes third-party support for settings and commerce trees. To inject into additional trees, implement an ITreeHelper to extract necessary data. 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, register the DI container in your startup class.

Once registered, any virtual subtree assigned to the helper’s tree alias will use it to locate required data.

AddSection(string name, Lambda sectionConfig = null) : SectionConfigBuilder
config.AddSection("Repositories", sectionConfig => {
    ...
});
AddSectionBefore(string beforeAlias, string name, Lambda sectionConfig = null) : SectionConfigBuilder
config.AddSectionBefore("settings", "Repositories", sectionConfig => {
    ...
});
AddSectionAfter(string afterAlias, string name, Lambda sectionConfig = null) : SectionConfigBuilder
config.AddSectionAfter("media", "Repositories", sectionConfig => {
    ...
});
SetAlias(string alias) : SectionConfigBuilder
sectionConfig.SetAlias("repositories");
Tree(Lambda treeConfig = null) : TreeConfigBuilder
sectionConfig.Tree(treeConfig => {
    ...
});
AddDashboard(string name, Lambda dashboardConfig = null) : DashboardConfigBuilder
sectionConfig.AddDashboard("Team", dashboardConfig => {
    ...
});
AddDashboardBefore(string beforeAlias, string name, Lambda dashboardConfig = null) : DashboardConfigBuilder
sectionConfig.AddDashboardBefore("contentIntro", "Team", dashboardConfig => {
    ...
});
AddDashboardAfter(string afterAlias, string name, Lambda dashboardConfig = null) : DashboardConfigBuilder
sectionConfig.AddDashboardAfter("contentIntro", "Team", dashboardConfig => {
    ...
});
WithSection(string alias, Lambda sectionConfig = null) : WithSectionConfigBuilder
config.WithSection("member", withSectionConfig => {
    ...
});
AddTree(string name, string icon, Lambda treeConfig = null) : TreeConfigBuilder
withSectionConfig.AddTree("My Tree", "icon-folder", treeConfig => {
    ...
});
AddTree(string groupName, string name, string icon, Lambda treeConfig = null) : TreeConfigBuilder
withSectionConfig.AddTree("My Group", "My Tree", "icon-folder", treeConfig => {
    ...
});
AddTreeBefore(string treeAlias, string name, string icon, Lambda treeConfig = null) : TreeConfigBuilder
withSectionConfig.AddTreeBefore("member", "My Tree", "icon-folder", treeConfig => {
    ...
});
AddTreeAfter(string treeAlias, string name, string icon, Lambda treeConfig = null) : TreeConfigBuilder
withSectionConfig.AddTreeAfter("member", "My Tree", "icon-folder", treeConfig => {
    ...
});
AddDashboard (string name, Lambda dashboardConfig = null) : DashboardConfigBuilder
withSectionConfig.AddDashboard("Team", dashboardConfig => {
    ...
});
AddDashboardBefore (string beforeAlias, string name, Lambda dashboardConfig = null) : DashboardConfigBuilder
withSectionConfig.AddDashboardBefore("contentIntro", "Team", dashboardConfig => {
    ...
});
AddDashboardAfter (string afterAlias, string name, Lambda dashboardConfig = null) : DashboardConfigBuilder
withSectionConfig.AddDashboardAfter("contentIntro", "Team", dashboardConfig => {
    ...
});
Trees
Dashboards
Dashboards
Dashboards
Trees
Trees
Trees
Trees
Dashboards
Dashboards
Dashboards
Sections
AddVirtualSubTree(string sectionAlias, string treeAlias, Lambda visibilityExpression, Lambda virtualSubTreeConfig = null) : VirtualSubTreeConfigBuilder
withTreeConfig.AddVirtualSubTree(ctx => ctx.Source.Id == 1056, contextAppConfig => {
    ...
});
AddVirtualSubTreeBefore(string sectionAlias, string treeAlias, Lambda visibilityExpression, Lambda matchExpression, Lambda virtualSubTreeConfig = null) : VirtualSubTreeConfigBuilder
withTreeConfig.AddVirtualSubTreeBefore(ctx => ctx.Source.Id == 1056, treeNode => treeNode.Name == "Settings", contextAppConfig => {
    ...
});
AddVirtualSubTreeAfter(string sectionAlias, string treeAlias, Lambda visibilityExpression, Lambda matchExpression, Lambda virtualSubTreeConfig = null) : VirtualSubTreeConfigBuilder
withTreeConfig.AddVirtualSubTreeAfter(ctx => ctx.Source.Id == 1056, treeNode => treeNode.Name == "Settings", contextAppConfig => {
    ...
});
public class VirtualSubTreeFilterContext
{
    public NodeContext Source { get; }
    public IEnumerable<IReadOnlyUserGroup> UserGroups { get; }
    public IServiceProvider ServiceProvider { get; }
}

public class NodeContext
{
    public string Id { get; }
    public string TreeAlias { get; }
    public string SectionAlias { get; }
    public FormCollection QueryString { get; }
}
withTreeConfig.AddVirtualSubTree(ctx =>
    {
        using var umbracoContextRef = ctx.ServiceProvider.GetRequiredService<IUmbracoContextFactory>().EnsureUmbracoContext();

        if (!int.TryParse(ctx.Source.Id, out int id))
            return false;

        return (umbracoContextRef.UmbracoContext.Content.GetById(id)?.ContentType.Alias ?? "") == "textPage";
    },
    virtualNodeConfig => virtualNodeConfig
        ...
);
public class TreeNode
{
    public object Id { get; }
    public object ParentId { get; }
    public string Alias { get; }
    public string Name { get; }
    public string NodeType { get; }
    public string Path { get; }
    public string RoutePath { get; }
    public IDictionary<string, object> AdditionalData { get; }
    ...
}
treeNode => treeNode.alias == "settings"
public interface ITreeHelper
{
    string TreeAlias { get; }
    string GetUniqueId(string nodeId, FormCollection queryString);
    object GetEntityId(string uniqueId);
    string GetPath(string uniqueId);
}
builder.Services.AddSingleton<ITreeHelper, MyCustomTreeHelper>();
WithTreeConfigBuilder
Trees
Umbraco Commerce
Virtual sub tree injected into a Commerce store tree

Related Collections

Configuring Many-to-Many Relationships in Umbraco UI Builder

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 support the editing of many-to-many relationships in UI Builder. These are used when multiple entities from one collection are linked to multiple entities from another collection, commonly represented through a junction table.

Example Use Case

A classic example is the relationship between Students and Courses, where each student takes many courses, and each course has many students.

Child Collection
Parent Collection
Entity Picker

Collections Representation

This is how the collections would be represented:

Related Collections Diagram

The models representing the entities would be as follows:

[TableName("Students")]
[PrimaryKey("Id")]
public class Student
{
    [PrimaryKeyColumn]
    public int Id { get; set; }

    public string FirstName { get; set; }

    public string LastName { get; set; }

    public string Email { get; set; }
}
[TableName("Courses")]
[PrimaryKey("Id")]
public class Course
{
    [PrimaryKeyColumn]
    public int Id { get; set; }

    public string Title { get; set; }

    public string Description { get; set; }
}
[TableName("StudentsCourses")]
[PrimaryKey(new[] { "StudentId", "CourseId" })]
public class StudentCourse
{
    [PrimaryKeyColumn]
    public int StudentId { get; set; }

    [PrimaryKeyColumn]
    public int CourseId { get; set; }
}

Defining a Related Collection

To define a related collection, follow these two steps:

  1. Add the collection definition

  2. Add the related collection entity picker and definition

Collection definition

Define a related collection by calling the AddRelatedCollection method on the collection config builder instance.

Using the AddRelatedCollection() Method

This method adds a related collection to the current collection, specifying names, descriptions, and default icons. The ID property must be defined, and the relation configuration defines the junction entity with references to parent and child entities.

Method Syntax

AddRelatedCollection<TEntityType, TRelatedEntityType, TJunctionEntityType>(Expression<Func<TRelatedEntityType, object>> idPropertyExpression, string nameSingular, string namePlural, Action<RelationConfigBuilder<TBuilder, TEntity, TRelatedEntityType, TJunctionEntityType>> relationConfig)

Example

collectionConfig.AddRelatedCollection<Student, Course, StudentCourse>(x => x.Id, "Student Course", "Students Courses", relationConfig =>
{
    relationConfig
        .SetAlias("studentsCourses")
        .SetJunction<StudentCourse>(x => x.StudentId, y => y.CourseId);
});

Configuring a Related Collection Entity Picker

Define the child collection entity picker by calling the AddRelatedCollectionPickerField method on the parent collection's fieldset config.

Using the AddRelatedCollectionPickerField() Method

This method adds an entity picker with the specified Data Type name to the parent collection editor.

Method Syntax

AddRelatedCollectionPickerField<TValueType>(string alias, string dataTypeName, string label)

Example

collectionConfig.Editor(editorConfig =>
{
    editorConfig.AddTab("General", tabConfig =>
        tabConfig.AddFieldset("General", fieldsetConfig =>
        {
            fieldsetConfig.AddField(x => x.FirstName).MakeRequired();
            fieldsetConfig.AddField(x => x.LastName).MakeRequired();
            fieldsetConfig.AddField(x => x.Email).MakeRequired();

            fieldsetConfig.AddRelatedCollectionPickerField<Course>("studentsCourses", "Courses Related Picker", "Courses");
        }));
});

The relation config alias must match the related collection picker field alias, for example, studentsCourses.

Defining Repository Methods

Using the GetRelationsByParentIdImpl<>() Method

Retrieves related collections based on the ID of the parent entity.

Method Syntax

IEnumerable<StudentCourse> GetRelationsByParentIdImpl<StudentCourse>(int parentId, string relationAlias)

Example

{
    var db = _scopeProvider.CreateScope().Database;
    var sql = db.SqlContext.Sql()
            .Select(new[] { "StudentId", "CourseId" } )
            .From("StudentsCourses")
            .Where($"studentId = @0", parentId);

    var result = db.Fetch<StudentCourse>(sql);

    return result;
}

Using the SaveRelationImpl<>() Method

Adds a new related collection to the current parent entity.

Method Syntax

StudentCourse SaveRelationImpl<StudentCourse>(StudentCourse entity)

Example

{
    var db = _scopeProvider.CreateScope().Database;

    var type = entity.GetType();
    var studentId = type.GetProperty("StudentId").GetValue(entity);
    var courseId = type.GetProperty("CourseId").GetValue(entity);

    // delete relation if exists
    db.Execute("DELETE FROM StudentsCourses WHERE StudentId = @0 AND CourseId = @1",
        studentId,
        courseId);

    db.Execute("INSERT INTO StudentsCourses (StudentId, CourseId) VALUES (@0, @1)",
        studentId,
        courseId);

    return entity;
}

Context Apps

Configuring context apps in Umbraco UI Builder.

Context Apps in Umbraco UI Builder function similarly to Workspace Views (previously called as 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 Workspace View.

Context App

Defining a Context App

You can define a context app by calling one of the AddContextApp methods on a WithTreeConfigBuilder instance.

Using the AddContextApp() Method

Adds a context app with the specified name and default icon.

Method Syntax

AddContextApp(string name, Lambda contextAppConfig = null) : ContextAppConfigBuilder

Example

withTreeConfig.AddContextApp("Comments", contextAppConfig => {
    ...
});

Using the AddContextApp() Method with Custom Icon

Adds a context app with the specified name and custom icon.

Method Syntax

AddContextApp(string name, string icon, Lambda contextAppConfig = null) : ContextAppConfigBuilder

Example

withTreeConfig.AddContextApp("Comments", "icon-chat", contextAppConfig => {
    ...
});

Using the AddContextAppBefore() Method

Adds a context app with the specified name and default icon before another context app specified by its alias.

Method Syntax

AddContextAppBefore(string beforeAlias, string name, Lambda contextAppConfig = null) : ContextAppConfigBuilder

Example

withTreeConfig.AddContextAppBefore("umbContent", "Comments", contextAppConfig => {
    ...
});

Using the AddContextAppBefore() Method with a Custom Icon

Adds a context app with the specified name and custom icon before another context app specified by its alias.

Method Syntax

AddContextAppBefore(string beforeAlias, string name, string icon, Lambda contextAppConfig = null) : ContextAppConfigBuilder

Example

withTreeConfig.AddContextAppBefore("umbContent", "Comments", "icon-chat", contextAppConfig => {
    ...
});

Using the AddContextAppAfter() Method

Adds a context app with the specified name and default icon after another context app specified by its alias.

Method Syntax

AddContextAppAfter(string afterAlias, string name, Lambda contextAppConfig = null) : ContextAppConfigBuilder

Example


withTreeConfig.AddContextAppAfter("umbContent", "Comments", contextAppConfig => {
    ...
});

Using the AddContextAppAfter() Method with a Custom Icon

Adds a context app with the specified name and custom icon after another context app specified by its alias.

Method Syntax

AddContextAppAfter(string afterAlias, string name, string icon, Lambda contextAppConfig = null) : ContextAppConfigBuilder

Example

withTreeConfig.AddContextAppAfter("umbContent", "Comments", "icon-chat", contextAppConfig => {
    ...
});

Changing a Context App Alias

Using the SetAlias() Method

Sets 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.

Method Syntax

SetAlias(string alias) : ContextAppConfigBuilder

Example

contextAppConfig.SetAlias("comments");

Changing a Context App Icon Color

Using the SetIconColor() Method

Sets the context app icon color to the given color. The available colors are: black, green, yellow, orange, blue or red.

Method Syntax

SetIconColor(string color) : ContextAppConfigBuilder

Example

contextAppConfig.SetIconColor("blue");

Changing Context App Visibility

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 Workspace View 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.

Using the SetIconColor() Method

Defines the visibility of the context app based on a delegate expression.

Method Syntax

SetVisibility(Func<ContextAppVisibilityContext, bool> visibilityExpression) : ContextAppConfigBuilder

Example

contextAppConfig.SetVisibility(appCtx => appCtx.Source is IContent content && content.ContentType.Alias == "blogPost");

Adding a Collection to a Context App

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.

Using the AddCollection<>() Method

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 Collections article.

Method Syntax

AddCollection<TEntityType>(
    Lambda idFieldExpression, 
    Lambda fkFieldExpression, 
    string nameSingular, 
    string namePlural, 
    string description, 
    Lambda collectionConfig = null
) : ContextAppConfigBuilder

Example

contextAppConfig.AddCollection<Comment>(
    p => p.Id, 
    p => "Comment", 
    "Comments", 
    "A collection of comments", 
    collectionConfig => {
        // Collection configuration here
    }
);

Using the AddCollection<>() Method with Custom Icon

AddCollection<TEntityType>(Lambda idFieldExpression, Lambda fkFieldExpression, string nameSingular, string namePlural, string description, string iconSingular, string iconPlural, Lambda collectionConfig = null) : ContextAppConfigBuilder

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 Collections article.

Method Syntax

AddCollection<TEntityType>(
    Lambda idFieldExpression, 
    Lambda fkFieldExpression, 
    string nameSingular, 
    string namePlural, 
    string description, 
    string iconSingular, 
    string iconPlural, 
    Lambda collectionConfig = null
) : ContextAppConfigBuilder

Example

contextAppConfig.AddCollection<Comment>(
    p => p.Id, 
    "Comment", 
    "Comments", 
    "A collection of comments", 
    "icon-chat", 
    "icon-chat", 
    collectionConfig => {
        // Collection configuration here
    }
);

Editors

Configuring the editor of a collection in Umbraco UI Builder.

An editor is the user interface used to edit an entity. It consists of tabs and property editors.

A collection editor

Configuring an Editor

The editor configuration is a sub-configuration of a Collection config builder instance and is accessed via the Editor method.

Using the Editor() Method

Accesses the editor configuration for the specified collection.

Method Syntax

Editor(Lambda editorConfig = null) : EditorConfig<TEntityType>

Example

collectionConfig.Editor(editorConfig => {
    ...
});

Adding a Tab to an Editor

Using the AddTab() Method

Adds a tab to the editor.

Method Syntax

AddTab(string name, Lambda tabConfig = null) : EditorTabConfigBuilder<TEntityType>

Example

editorConfig.AddTab("General", tabConfig => {
    ...
});

Configuring a Sidebar to a Tab

A sidebar is a smaller section displayed on the right side of the main editor. It can contain fieldsets and fields, similar to tabs, but with limited space. The sidebar is ideal for displaying entity metadata.

Using the Sidebar() Method

Configures the sidebar for the tab.

Method Syntax

Sidebar(Lambda sidebarConfig = null) : EditorTabSidebarConfigBuilder<TEntityType>

Example

tabConfig.Sidebar(sidebarConfig => {
    ...
});

Setting the Visibility of a Tab

Using the SetVisibility() Method for Tabs

Determines the visibility of the tab at runtime.

Method Syntax

SetVisibility(Predicate<EditorTabVisibilityContext> visibilityExpression) : EditorTabConfigBuilder<TEntityType>

Example

tabConfig.SetVisibility(ctx => ctx.EditorMode == EditorMode.Create);

Adding a Fieldset to a Tab

Using the AddFieldset() Method

Adds a fieldset to a tab.

Method Syntax

AddFieldset(string name, Lambda fieldsetConfig = null) : EditorFieldsetConfigBuilder<TEntityType>

Example

tabConfig.AddFieldset("Contact", fieldsetConfig => {
    ...
});

Setting the Visibility of a Fieldset

Using the SetVisibility() Method for Fieldsets

Determines the visibility of a fieldset at runtime.

Method Syntax

SetVisibility(Predicate<EditorFieldsetVisibilityContext> visibilityExpression) : EditorFieldsetConfigBuilder<TEntityType>

Example

fieldsetConfig.SetVisibility(ctx => ctx.EditorMode == EditorMode.Create);

Adding a Field to a Fieldset

Using the AddField() Method

Adds a property field to the editor.

Method Syntax

AddField(Lambda propertyExpression, Lambda propertyConfig = null) : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldsetConfig.AddField(p => p.FirstName, fieldConfig => {
    ...
});

Changing the Label of a Field

By default, Umbraco UI Builder converts property names into readable labels by splitting camel case names. You can override this behavior by setting an explicit label.

Using the SetLabel() Method

Sets a custom label for a field.

Method Syntax

SetLabel(string label) : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.SetLabel("First Name");

Hiding the Label of a Field

Sometimes, a field works better without a label, especially in full-width layouts.

Using the HideLabel() Method

Hides the field label.

Method Syntax

HideLabel() : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.HideLabel();

Adding a Description to a Field

Using the SetDescription() Method

Adds a description to the field.

Method Syntax

SetDescription(string description) : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.SetDescription("Enter your age in years");

Changing the Data Type of a Field

By default, Umbraco UI Builder assigns a suitable Data Type for basic field types. However, you can specify a custom Data Type.

Using the SetDataType() Method

Assigns an Umbraco Data Type by name or ID.

Method Syntax (by name)

SetDataType(string dataTypeName) : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.SetDataType("Richtext Editor");

Method Syntax (by ID)

SetDataType(int dataTypeId) : EditorFieldConfigBuilder<TEntityType, TValueType>

Example


fieldConfig.SetDataType(-88);

Setting the Default Value of a Field

Using the SetDefaultValue() Method

Sets a static default value.

Method Syntax

SetDefaultValue(TValueType defaultValue) : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

// Example
fieldConfig.SetDefaultValue(10);

Using the SetDefaultValue() Method (Function-Based)

Defines a function to compute the default value at the time of entity creation.

Method Syntax

SetDefaultValue(Func defaultValueFunc) : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.SetDefaultValue(() => DateTime.Now);

Making a Field Required

Using the MakeRequired() Method

Marks a field as required.

Method Syntax

MakeRequired() : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.MakeRequired();

Validating a Field

Using the SetValidationRegex() Method

Applies a regular expression for field validation.

Method Syntax

SetValidationRegex(string regex) : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.SetValidationRegex("[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}");

Making a Field Read-only

Using the MakeReadOnly() Method

This method makes the current field read-only, preventing any user modifications in the UI. Once applied, the field's value remains visible but cannot be edited.

Method Syntax

MakeReadOnly() : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.MakeReadOnly();

Using the MakeReadOnly(Func<TValueType, string>) Method

This method makes the current field read-only, preventing user edits in the UI. Additionally, it allows specifying a custom formatting expression, which determines how the field value is displayed as a string.

Method Syntax

MakeReadOnly(Func<TValueType, string> format) : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.MakeReadOnly(distanceProp => $"{distanceProp:## 'km'}");

Using the MakeReadOnly(object dataTypeNameOrId) Method

This method makes the current field read-only, preventing user edits in the UI. Additionally, it allows specifying a Data Type name or ID to determine how the field should be rendered when in read-only mode.

Method Syntax

MakeReadOnly(object dataTypeNameOrId) : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.MakeReadOnly("myReadOnlyEditor");

Using the MakeReadOnly(Predicate<>) Method

This method makes the current field read-only in the UI if the provided runtime predicate evaluates to true, preventing user edits.

Method Syntax

MakeReadOnly(Predicate<EditorFieldReadOnlyContext> readOnlyExp) : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.MakeReadOnly(ctx => ctx.EditorMode == EditorMode.Create);

Using the MakeReadOnly(Predicate<>, Func<>) Method

This method makes the current field read-only in the UI if the provided runtime predicate evaluates to true, preventing user edits. It also allows specifying a custom formatting expression to render the field’s value as a string.

Method Syntax

MakeReadOnly(Predicate<EditorFieldReadOnlyContext> readOnlyExp, Func<TValueType, string> format) : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.MakeReadOnly(ctx => ctx.EditorMode == EditorMode.Create, distanceProp => $"{distanceProp:## 'km'}");

Using the MakeReadOnly(Predicate<>, Func<>) Method

This method makes the current field read-only in the UI if the provided runtime predicate evaluates to true, preventing user edits. It also allows specifying a Data Type name or ID to use when the field is in read-only mode.

Method Syntax

MakeReadOnly(Predicate<EditorFieldReadOnlyContext> readOnlyExp, object dataTypeNameOrId) : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.MakeReadOnly(ctx => ctx.EditorMode == EditorMode.Create, "myReadOnlyEditor");

Setting the Visibility of a Field

Using the SetVisibility() Method for Fields

Controls field visibility at runtime.

Method Syntax

SetVisibility(Predicate<EditorFieldVisibilityContext> visibilityExpression) : EditorFieldConfigBuilder<TEntityType, TValueType>

Example

fieldConfig.SetVisibility(ctx => ctx.EditorMode == EditorMode.Create);

Trees

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.

Configuring a Umbraco UI Builder Section Tree

The tree configuration for Umbraco UI Builder sections is part of the config builder and is accessed via its Tree method.

Using the Tree() Method

This method defines the structure and behavior of a tree within a section.

Method Syntax

Example

Adding a Tree to an Existing Section

To add a tree to an existing section, use one of the AddTree methods from the config builder.

Using the AddTree() method

This method adds a tree to the current section, specifying its name and icon.

Method Syntax

Example

Grouping Trees with AddTree() Method

This method adds a tree to the current section under a specified group.

Method Syntax

Example

Using AddTreeBefore() to Position a Tree

This method adds a tree to the current section before the tree with the specified alias.

Method Syntax

Example

Using AddTreeAfter() to Position a Tree

This method adds a tree to the current section after the tree with the specified alias.

Method Syntax

Example

Changing the Tree Icon Color

Using the SetIconColor() Method

This 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.

Method Syntax

Example

Adding a Group to a Tree

Using the AddGroup() Method

This method adds a group to the current tree with the specified name.

Only trees in Umbraco UI Builder sections support groups.

Method Syntax

Example

Adding a Folder to a Tree or Group

Using the AddFolder() Method

This method adds a folder node inside a tree or group, using the default folder icon. For more details, see the article.

Method Syntax

Example

Using the AddFolder() Method with Custom Icon

This method adds a folder with a specified icon inside a tree or group. For more details, see the article.

Method Syntax

Example

Adding a Collection to a Tree or Group

Using the AddCollection<>() Method

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.

Method Syntax

Example

Using the AddCollection<>() Method with Icons

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.

Method Syntax

Example

Extending an Existing Tree

To extend existing trees, call the WithTree method on a instance.

Using the WithTree() Method

This method starts a sub-configuration for an existing tree with the specified alias.

Method Syntax

Example

Adding a Context App to an Existing Tree

Using the AddContextApp() Method

This method adds a context app with the specified name and default icon. For more details, see the article.

Method Syntax

Example

Using the AddContextApp() Method with Custom Icon

This method adds a context app with the specified name and custom icon. For more details, see the article.

Method Syntax

Example

Adding a Context App Before or After Another Context App

Using the AddContextApp() Method Before Another Context App

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.

Method Syntax

Example

Using the AddContextApp() Method with Custom Icon Before Another Context App

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.

Method Syntax

Example

Using the AddContextApp() Method After Another Context App

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.

Method Syntax

Example

Using the AddContextApp() Method with Custom Icon After Another Context App

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.

Method Syntax

Example

Tree(Lambda treeConfig = null) : TreeConfigBuilder
sectionConfig.Tree(treeConfig => {
    ...
});
AddTree(string name, string icon, Lambda treeConfig = null) : TreeConfigBuilder
withSectionConfig.AddTree("My Tree", "icon-folder", treeConfig => {
    ...
});
AddTree(string groupName, string name, string icon, Lambda treeConfig = null) : TreeConfigBuilder
withSectionConfig.AddTree("My Group", "My Tree", "icon-folder", treeConfig => {
    ...
});
AddTreeBefore(string treeAlias, string name, string icon, Lambda treeConfig = null) : TreeConfigBuilder
withSectionConfig.AddTreeBefore("member", "My Tree", "icon-folder", treeConfig => {
    ...
});
AddTreeAfter(string treeAlias, string name, string icon, Lambda treeConfig = null) : TreeConfigBuilder
withSectionConfig.AddTreeAfter("member", "My Tree", "icon-folder", treeConfig => {
    ...
});
SetIconColor(string color) : TreeConfigBuilder
collectionConfig.SetIconColor("blue");
AddGroup(string name, Lambda groupConfig = null) : GroupConfigBuilder
treeConfig.AddGroup("Settings", groupConfig => {
    ...
});
AddFolder(string name, Lambda folderConfig = null) : FolderConfigBuilder
treeConfig.AddFolder("Settings", folderConfig => {
    ...
});
AddFolder(string name, string icon, Lambda folderConfig = null) : FolderConfigBuilder
treeConfig.AddFolder("Settings", "icon-settings", folderConfig => {
    ...
});
AddCollection<TEntityType>(
    Lambda idFieldExpression, 
    string nameSingular, 
    string namePlural, 
    string description, 
    Lambda collectionConfig = null
) : CollectionConfigBuilder<TEntityType>
treeConfig.AddCollection<Person>(
    p => p.Id, 
    "Person", 
    "People", 
    "A collection of people", 
    collectionConfig => {
        ...
    }
);
AddCollection<TEntityType>(
    Lambda idFieldExpression, 
    string nameSingular, 
    string namePlural, 
    string description, 
    string iconSingular, 
    string iconPlural, 
    Lambda collectionConfig = null
) : CollectionConfigBuilder<TEntityType>
treeConfig.AddCollection<Person>(
    p => p.Id, 
    "Person", 
    "People", 
    "A collection of people", 
    "icon-umb-users", 
    "icon-umb-users", 
    collectionConfig => {
        ...
    }
);
WithTree(string alias, Lambda treeConfig = null) : WithTreeConfigBuilder
sectionConfig.WithTree("content", withTreeConfig => {
    ...
});
AddContextApp(string name, Lambda contextAppConfig = null) : ContextAppConfigBuilder
withTreeConfig.AddContextApp("Comments", contextAppConfig => {
    ...
});
AddContextApp(string name, string icon, Lambda contextAppConfig = null) : ContextAppConfigBuilder
withTreeConfig.AddContextApp("Comments", "icon-chat", contextAppConfig => {
    ...
});
AddContextAppBefore(string beforeAlias, string name, Lambda contextAppConfig = null) : ContextAppConfigBuilder
withTreeConfig.AddContextAppBefore("umbContent", "Comments", contextAppConfig => {
    ...
});
AddContextAppBefore(string beforeAlias, string name, string icon, Lambda contextAppConfig = null) : ContextAppConfigBuilder
withTreeConfig.AddContextAppBefore("umbContent", "Comments", "icon-chat", contextAppConfig => {
    ...
});
AddContextAppAfter(string afterAlias, string name, Lambda contextAppConfig = null) : ContextAppConfigBuilder
withTreeConfig.AddContextAppAfter("umbContent", "Comments", contextAppConfig => {
    ...
});
AddContextAppAfter(string afterAlias, string name, string icon, Lambda contextAppConfig = null) : ContextAppConfigBuilder
withTreeConfig.AddContextAppAfter("umbContent", "Comments", "icon-chat", contextAppConfig => {
    ...
});
Section
WithSection
Folders
Folders
Collections
Collections
WithSectionConfigBuilder
Context Apps
Context Apps
Context Apps
Context Apps
Context Apps
Context Apps
Tree

The Basics

An overview of the basics of configuring a collection in Umbraco UI Builder.

A collection configuration in Umbraco UI Builder defines how collections are structured and displayed in the backoffice. This guide covers the core concepts, with additional options available in other configuration sections.

Defining a Collection

A collection is defined using the AddCollection method on a Tree or parent Folder configuration instance.

Using the AddCollection() Method

Adds a collection to the given container with the specified names, description, and default icons. The ID property must be defined.

Method Syntax

AddCollection<TEntityType>(Lambda idFieldExpression, string nameSingular, string namePlural, string description, Lambda collectionConfig = null) : CollectionConfigBuilder<TEntityType>

Example

folderConfig.AddCollection<Person>(p => p.Id, "Person", "People", "A collection of people", collectionConfig => {
    ...
});

Using the AddCollection() Method with Icons

Adds a collection to the given container with the specified names, description, and icons. The ID property must be defined.

Method Syntax

AddCollection<TEntityType>(Lambda idFieldExpression, string nameSingular, string namePlural, string description, string iconSingular, string iconPlural, Lambda collectionConfig = null) : CollectionConfigBuilder<TEntityType>

Example

folderConfig.AddCollection<Person>(p => p.Id, "Person", "People", "A collection of people", "icon-umb-users", "icon-umb-users", collectionConfig => {
    ...
});

Changing a Collection Alias

Using the SetAlias() Method

Sets the alias of the collection.

Optional: When creating a new collection, an alias is automatically generated from the supplied name for you. To customize the alias, the SetAlias method can be used.

Method Syntax

SetAlias(string alias) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.SetAlias("person");

Changing a Collection Icon Color

Using the SetIconColor() Method

Sets the collection icon color to the given color. The available options are black, green, yellow, orange, blue, or red.

Method Syntax

SetIconColor(string color) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.SetIconColor("blue");

Defining an Entity Name

In Umbraco, every entity is expected to have a name property. To ensure the Umbraco UI Builder knows which property to use, you must specify it.

If the entity lacks a dedicated name property, you can define how to construct a name using other properties. This is done using either the SetNameProperty or SetNameFormat methods on a Collection config builder instance.

Using the SetNameProperty() Method

Specifies the entity property to use as the name, which must be of type string. This property serves as the label in trees and list views, appears in the editor interface header, and is automatically included in searchable properties. It is also used as the default sorting property.

Method Syntax

SetNameProperty(Lambda namePropertyExpression) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.SetNameProperty(p => p.Name);

Using the SetNameProperty() Method with Custom Heading

Specifies which property of your entity should be used as the name property and defines a custom heading for the list view column. The property must be of type string.

Setting a name property ensures its value is displayed as the label for the entity in trees and list views. It will also be editable in the editor interface's header region.

Additionally, the property is automatically added to the searchable properties collection and used as the default sort property.

Method Syntax

SetNameProperty(Lambda namePropertyExpression, string heading) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.SetNameProperty(p => p.Name, "Person Name");

Using the SetNameFormat() Method

Defines a format expression to dynamically generate a label for the entity in trees and list views.

This method is used when there is no single name property available on the entity. As a result, none of the default behaviors of the SetNameProperty method, such as automatic sorting, searching, or header editing, will apply.

Method Syntax

SetNameFormat(Lambda nameFormatExpression) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.SetNameFormat(p => $"{p.FirstName} {p.LastName}");

Defining a Default Sort Order

Using the SetSortProperty() Method

Specifies the property used to sort the collection, with the default sort direction set to ascending.

Method Syntax

SetSortProperty(Lambda sortPropertyExpression) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.SetSortProperty(p => p.FirstName);

Using the SetSortProperty() Method with Sort Direction

Defines the property of the entity to sort by, based on the specified sort direction.

Method Syntax

SetSortProperty(Lambda sortPropertyExpression, SortDirection sortDirection) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.SetSortProperty(p => p.FirstName, SortDirection.Descending);

Defining Time Stamp Properties

Using the SetDateCreatedProperty Method

Defines the property of the entity to use as the date created field. The property must be of type DateTime. When specified, this field will be automatically populated with the current date and time when a new entity is saved via the repository.

Method Syntax

SetDateCreatedProperty(Lambda dateCreatedProperty) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.SetDateCreatedProperty(p => p.DateCreated);

Using the SetDateModifiedProperty Method

Defines the property of the entity to use as the date modified field. The property must be of type DateTime. When specified, this field will be updated with the current date and time whenever the entity is saved via the repository.

Method Syntax

SetDateModifiedProperty(Lambda dateCreatedProperty) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.SetDateModifiedProperty(p => p.DateModified);

Configuring Soft Deletes

By default, entities deleted via the Umbraco UI Builder repository are permanently removed from the system. The SetDeletedProperty method marks records as deleted without removing them. This retains them in the data repository while hiding them from the UI.

Using the SetDeletedProperty() Method

Defines the property of the entity to use as the deleted flag. The property must be of type boolean or int. When set, delete actions will mark the entity as deleted by setting the flag instead of removing the entity.

For boolean properties, the flag is set to True when deleted. For int properties, the flag is set to a UTC Unix timestamp representing the deletion date. Additionally, fetch actions will automatically exclude deleted entities.

Method Syntax

SetDeletedProperty(Lambda deletedPropertyExpression) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.SetDeletedProperty(p => p.Deleted);

Disabling Create, Update, or Delete Features

Using the DisableCreate() Method

Disables the option to create entities within the current collection. Entities can still be created programmatically, after which editing is allowed through the UI.

Method Syntax

DisableCreate() : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.DisableCreate();

Using the DisableCreate() Method with Conditions

Disables entity creation within the current collection if the specified runtime predicate evaluates to true. Entities can still be created programmatically, after which editing is allowed in the UI.

Method Syntax

DisableCreate(Predicate<CollectionPermissionContext> disableExpression) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.DisableCreate(ctx => ctx.UserGroups.Any(x => x.Alias == "editor"));

Using the DisableUpdate() Method

Disables the option to update entities within the current collection. Entities can be created, but further editing is not permitted

Method Syntax

DisableUpdate() : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.DisableUpdate();

Using the DisableUpdate() Method with Conditions

Disables the option to update entities within the current collection if the specified runtime predicate evaluates to true. Entities can be created, but further editing is not permitted.

Method Syntax

DisableUpdate(Predicate<CollectionPermissionContext> disableExpression) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.DisableUpdate(ctx => ctx.UserGroups.Any(x => x.Alias == "editor"));

Using the DisableDelete() Method

Disables the option to delete entities within the current collection. This is useful when data needs to be retained and visible. For more information, see the Configuring Soft Deletes section.

Method Syntax

DisableDelete() : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.DisableDelete();

Using the DisableDelete() Method with Conditions

Disables the option to delete entities within the current collection if the specified runtime predicate evaluates to true. This is useful when data needs to be retained and visible. For more information, see the Configuring Soft Deletes section.

Method Syntax

DisableDelete(Predicate<CollectionPermissionContext> disableExpression) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.DisableDelete(ctx => ctx.UserGroups.Any(x => x.Alias == "editor"));

Using the MakeReadOnly() Method

Marks the collection as read-only, disabling all Create, Read, Update, and Delete (CRUD) operations via the UI.

Method Syntax

MakeReadOnly() : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.MakeReadOnly();

Using the MakeReadOnly() Method with Conditions

Marks the collection as read-only if the specified runtime predicate evaluates to true. This disables all Create, Read, Update, and Delete (CRUD) operations via the UI.

Method Syntax

MakeReadOnly(Predicate<CollectionPermissionContext> disableExpression) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.MakeReadOnly(ctx => ctx.UserGroups.Any(x => x.Alias == "editor"));

Setting Collection Visibility

Using the SetVisibility() Method

Sets the runtime visibility of the collection.

Method Syntax

SetVisibility(Predicate<CollectionVisibilityContext> visibilityExpression) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.SetVisibility(ctx => ctx.UserRoles.Any(x => x.Alias == "editor"));

Changing a Collection Connection String

By default, Umbraco UI Builder uses the Umbraco connection string for its database connection. You can override this by calling the SetConnectionString method on a Collection config builder instance.

Using the SetConnectionString() Method

Defines the connection string for the collection repository.

Method Syntax

SetConnectionString(string connectionStringName) : CollectionConfigBuilder<TEntityType>

Example

collectionConfig.SetConnectionString("myConnectionStringName");

Creating your First Integration

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.

By default, Umbraco UI Builder uses a database for data storage. However, you can configure this using a custom Repository class instead.

Setting Up the Database

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).

CREATE TABLE [Person] (
    [Id] int IDENTITY (1,1) NOT NULL,
    [Name] nvarchar(255) NOT NULL,
    [JobTitle] nvarchar(255) NOT NULL,
    [Email] nvarchar(255) NOT NULL,
    [Telephone] nvarchar(255) NOT NULL,
    [Age] int NOT NULL,
    [Avatar] nvarchar(255) NOT NULL
);

This script creates a table for storing people’s details. You may want to populate it with some dummy data for testing.

Setting Up the Model

With the database table created, define the Person model in your project.

To create a Model:

  1. Create a new folder called Models in your project.

  2. Add a new class file called Person.cs.

  3. Add the following code:

using NPoco;
using Umbraco.Cms.Infrastructure.Persistence.DatabaseAnnotations;

[TableName("Person")]
[PrimaryKey("Id")]
public class Person
{
    [PrimaryKeyColumn]
    public int Id { get; set; }
    public string? Name { get; set; }
    public string? JobTitle { get; set; }
    public string? Email { get; set; }
    public string? Telephone { get; set; }
    public int Age { get; set; }
    public string? Avatar { get; set; }
}

Configure Umbraco UI Builder

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.

The following steps cover the Program.cs approach. For more details, including configuring via a Composer, see the the Configuration article.

Configuring via Program.cs

  1. Open the Program.cs file in your project.

  2. Locate the CreateUmbracoBuilder() method.

  3. Add AddUIBuilder before AddComposers().

builder.CreateUmbracoBuilder()
    .AddBackOffice()
    .AddWebsite()
    .AddDeliveryApi()
    .AddComposers()
    .AddUIBuilder(cfg => {
        // Apply your configuration here
    })
    .Build();

Example Configuration

Here’s an example configuration defining a section, a list view, and an editor for managing Person entities:

...
.AddUIBuilder(cfg => {

    cfg.AddSectionAfter("media", "Repositories", sectionConfig => sectionConfig
        .Tree(treeConfig => treeConfig
            .AddCollection<Person>(x => x.Id, "Person", "People", "A person entity", "icon-umb-users", "icon-umb-users", collectionConfig => collectionConfig
                .SetNameProperty(p => p.Name)
                .ListView(listViewConfig => listViewConfig
                    .AddField(p => p.JobTitle).SetHeading("Job Title")
                    .AddField(p => p.Email)
                )
                .Editor(editorConfig => editorConfig
                    .AddTab("General", tabConfig => tabConfig
                        .AddFieldset("General", fieldsetConfig => fieldsetConfig
                            .AddField(p => p.JobTitle).MakeRequired()
                            .AddField(p => p.Age)
                            .AddField(p => p.Email).SetValidationRegex("[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+")
                            .AddField(p => p.Telephone).SetDescription("inc area code")
                        )
                        .AddFieldset("Media", fieldsetConfig => fieldsetConfig
                            .AddField(p => p.Avatar).SetDataType("Upload File")
                        )
                    )
                )
            )
        )
    );

})
...

Accessing the Umbraco Backoffice

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:

  1. Login to the Umbraco backoffice.

  2. Go to the Users section.

  3. Navigate to the user group you wish to assign the newly defined section.

User group permissions
  1. Submit the changes.

  2. Refresh the browser to view the new section.

Newly defined section

If you click on a person's name, you will see the following screen:

People editor

Summary

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.