Only this pageAll pages
Powered by GitBook
1 of 69

17.latest (LTS)

Loading...

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

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

Loading...

Loading...

Loading...

Miscellaneous

Loading...

Loading...

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

Code Reference: ShowOnSummaryDashboard() : CollectionConfigBuilder<TEntityType>

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

collectionConfig.ShowOnSummaryDashboard();

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.

Data Type config
  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.

Document Type config

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.

Entity picker dialog
  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.

Entity picker values

Retrieving the Value of an Entity Picker

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

// Example
foreach(var p in Model.People){
    ...
}

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

Name
Alias
Name
Alias
Name
Alias
Name
Alias
Name
Alias
Name
Alias
Name
Alias
Name
Alias
Name
Alias

Health Check

settingsHealthCheck

Users

users

Members

member

Forms

forms

Translation

translation

contentRedirectManager

Content

mediaFolderBrowser

Welcome

settingsWelcome

Examine Management

settingsExamine

Published Status

settingsPublishedStatus

Models Builder

Getting Started

memberIntro

Content

umbContent

Info

umbInfo

Content

umbContent

Info

umbInfo

Content

umbContent

Info

umbInfo

Design

design

List View

listView

Permissions

permissions

Templates

Content

content

Media

media

Settings

settings

Packages

Content

content

Media

media

Members

member

Member Groups

Media

Settings

Members

Workspace Views Aliases

Content

Media

Members

ContentTypes

Section Aliases

Tree Aliases

settingsModelsBuilder

templates

packages

memberGroups

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.

If you have a custom data store that you want to manage within Umbraco, you can use Umbraco UI Builder. With few lines of code, you can configure a custom administration UI, and reuse many core components with a consistent look and feel.

With Umbraco UI Builder, custom backoffice integrations can now be set up in minutes rather than days.

This documentation is intended for developers with a basic understanding of Umbraco and C#/MVC principles.

If you are new to Umbraco UI Builder, it is recommended to start with the section. This section covers system requirements and installation instructions.

Once you have Umbraco UI Builder installed, explore the

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.

While Umbraco UI Builder supports persisting tag values, it currently does not write these tags to the cmsTags database table. This functionality is managed by the internal tagsRepository, which is not publicly accessible, preventing direct saving in the same manner as Umbraco Core.

Block Editors (Block List/Block Grid) are not currently supported due to casting errors between the JSON string representation and collection property.

An implementation to address this is investigated and will be scheduled for a future major release.

Legacy Documentation

This documentation platform covers only major versions of Umbraco UI Builder. If you are using an unsupported version, you need to go elsewhere.

Property Editors

Tags

Block Editors

Umbraco 10 and above Documentation

section. This section provides a quick-start example on configuring Umbraco UI Builder.

Use the main menu to explore features in detail and navigate directly to topics of interest.

For additional resources and best practices, visit the Miscellaneous section.

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

Using The Documentation

Getting Started
Example Umbraco UI Builder UI

Getting Help

Guides

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 for breaking changes.

Legacy Version Upgrade Notes

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

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

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

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

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

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.

Run the following command in your web project:

For a class library without UI elements, install:

To install via Visual Studio, follow these steps:

  1. Open Visual Studio and load your project.

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.

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.

Context Apps
Release Notes

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.

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

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

Example

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

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

For a complete sample configuration, see the Creating your First Integration article.

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

Option 1: Configuring via a Composer

Option 2: Configuring via Program.cs

Example Configuration

collectionConfig.SetFilter(p => p.Current);
AddEncryptedProperty(Lambda encryptedPropertyExpression) : CollectionConfigBuilder<TEntityType>
collectionConfig.AddEncryptedProperty(p => p.Secret);
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();
Go to Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution...
  • Select the Browse tab and search for Umbraco.UIBuilder.

  • Installing Umbraco UI Builder via Visual Studio
    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:

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

    dotnet add package Umbraco.UIBuilder
    dotnet add package Umbraco.UIBuilder.Startup

    Install via Command Line

    Install via Visual Studio

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

    Installing a License

    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 Umbraco installation. This means one license covers a single Umbraco database and its associated web project.

    While the license is sold per installation, it is configured on a domain basis. This allows the Umbraco licensing server to verify that the backoffice is being accessed from an authorized environment.

    The licenses are not tied to a specific product version. They work across all versions of the related product.

    Example License Configuration

    When you purchase a license, you define one production domain (which includes all its subdomains) and up to two development or testing domains.

    For a license configured for mysite.com, with development domains devdomain.com and devdomain2.com, the following are covered:

    • Local Development: localhost, *.local, and *.test.

    • Production: mysite.com and all subdomains (for example, www.mysite.com, shop.mysite.com).

    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.

    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.

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

    Once you've purchased your license with the correct domains, you are ready to configure the license key on your Umbraco installation.

    The license key should be added to your configuration using product ID: Umbraco.UIBuilder.

    For detailed instructions on how to install and configure your license, including version-specific examples and additional configuration options, see the article.

    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:

    • To specify a package version:

    • After adding the package reference, restore dependencies:

    1. Open Visual Studio.

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

    3. Select Umbraco.UIBuilder.

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

    Sub-package
    Description

    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.

    The Basics

    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.

    Searchable Properties

    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.

    Global FiltersData ViewsFilterable Properties

    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:

    Count CardsCustom Cards

    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)

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

    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.

    Bulk Actions UI

    To get started with actions, check out the basics:

    The Basics

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

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

    • Fixed issue with section dashboard collections

    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]

    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.

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

    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.

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

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

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

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

    Count Cards

    Learn how to configure count cards in Umbraco UI Builder.

    Count cards allow you to define cards directly against the configuration, providing a basic where clause to use in a count SQL statement. These work perfectly for basic data visualizations based on counts of entities in a collection.

    If you need to do more than a basic count, see the article.

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

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

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

    Child Collection Groups

    Configuring child collection groups in Umbraco UI Builder.

    A child collection group is a container for other child collections. Its purpose is mainly to provide a logical grouping of multiple child collections to help with organization and an improved user experience.

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

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

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

    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.

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

    The required methods are:

    Conventions

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

    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.

    • Methods prefixed with Add allow multiple configurations.

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

    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:

    Staging/QA: Your two specifically registered domains, such as devdomain.com and devdomain2.com.

    The license allows for an unlimited number of editable collections.

  • The license also includes localhost and *.local as a valid domain.

  • Only one license per Umbraco installation is allowed.

    What a License Covers?

    If you have multiple backoffice domains pointing at the same installation, you can purchase and add additional domains to your license.

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

    Purchasing your license

    Adding Additional Domains

    Configuring your license

    Umbraco UI Builder
    reach out to the sales team
    Configure Licenses

    Versioning

    versioning strategy laid out for Umbraco CMS
    Umbraco CMS Documentation
    Entity Picker

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

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

  • Static assets for the presentation layer

    Umbraco.UIBuilder.Startup

    Registers UI Builder with Umbraco

    Umbraco.UIBuilder

    The main UI Builder package

    Umbraco.UIBuilder.Core

    Core functionality without infrastructure dependencies

    Umbraco.UIBuilder.Infrastructure

    Infrastructure-specific implementations

    Umbraco.UIBuilder.Web

    Core logic requiring a web context

    Visual Studio

    Upgrade Sub-Packages

    Umbraco.UIBuilder.Web.StaticAssets

    Defining a Child Collection Group

    Using the AddChildCollectionGroup() Method

    Method Syntax

    Example

    Using the AddChildCollectionGroup() Method with Custom Icon

    Method Syntax

    Example

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

    Fluent Conventions

    Chaining Example

    Lambda Expression Example

    Naming Conventions

    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.

    UDI Identifiers
        [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; }
        }
    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.

    Defining Searchable Properties

    Using AddSearchableProperty() Method

    Method Syntax

    Example

    Search Expression Pattern

    Search

    Example

    {% hint style="info" %} The FieldViewContext parameter in the InvokeAsync method must be named context. {% endhint %}

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

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

    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.

    Defining a Field View

    Basic View File for the Built-In FieldView View Component

    Custom View Component

    The Field View Context

    Setting the Field View of a List View Field

    Sets the color for the count card.

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

    Sets a custom format for the card's value.

    Adding a Count Card to a Collection

    Using the AddCard() Method

    Method Syntax

    Example

    Using the AddCard() Method with Icon

    Method Syntax

    Example

    Change the Color of a Count Card

    Using the SetColor() Method

    Collection
    Custom Cards

    Method Syntax

    Example

    Add a Suffix to a Count Value

    Using the SetSuffix() Method

    Method Syntax

    Example

    Formatting the Value of a Count

    Using the SetFormat() Method

    Method Syntax

    Example

    GetDataViews: Returns the list of data views to choose from.
  • GetDataViewWhereClause: Returns the boolean where clause expression for the given data views alias.

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

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

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

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

    Defining a Data Views Builder

    Setting the Data Views Builder of a Collection

    Using the SetDataViewsBuilder() Method

    Method Syntax

    Example

    Using the SetDataViewsBuilder(Type) Method

    Method Syntax

    Example

    Using the SetDataViewsBuilder(DataViewsBuilder<TEntityType>) Method

    Method Syntax

    Example

    dotnet add package Umbraco.UIBuilder
    dotnet add package Umbraco.UIBuilder --version <VERSION>
    dotnet restore
    <ItemGroup>
      <PackageReference Include="Umbraco.UIBuilder" Version="xx.x.x" />
    </ItemGroup>
    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 => {
        ...
    });
    config.AddSection("Repositories", sectionConfig => {  
        sectionConfig.Tree(treeConfig => {  
            treeConfig.AddCollection<People>(p => p.Id, "Person", "People");  
        });  
    });
    AddSearchableProperty(Lambda searchablePropertyExpression) : CollectionConfigBuilder<TEntityType>
    collectionConfig.AddSearchableProperty(p => p.FirstName);
    collectionConfig.AddSearchableProperty(p => p.Address.Street);
    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.
    @model Umbraco.UIBuilder.Web.Models.FieldViewContext
    <!-- Insert your markup here -->
    // Example
    public class MyComplexFieldViewViewComponent : ViewComponent
    {
        public async Task<IViewComponentResult> InvokeAsync(FieldViewContext context)
        {
            // Do your custom logic here
    
            return View("Default", model);
        }
    }
    @model Namespace.Of.Model.Returned.By.Custom.ViewComponent
    <!-- Insert your markup here -->
    public class FieldViewContext
    {
        public string ViewName { get; set; }
        public object Entity { get; set; }
        public string PropertyName { get; set; }
        public object PropertyValue { get; set; }
    }
    AddCard(string name, Lambda whereClauseExpression, Lambda cardConfig = null) : CardConfigBuilder
    collectionConfig.AddCard("Older than 30", p => p.Age > 30, cardConfig => {
        ...
    });
    AddCard(string name, string icon, Lambda whereClauseExpression, Lambda cardConfig = null) : CardConfigBuilder
    collectionConfig.AddCard("Older than 30", "icon-umb-users", p => p.Age > 30, cardConfig => {
        ...
    });
    SetColor(string color) : CardConfigBuilder
    cardConfig.SetColor("blue");
    SetSuffix(string suffix) : CardConfigBuilder
    cardConfig.SetSuffix("years");
    SetFormat(Lambda formatExpression) : CardConfigBuilder
    cardConfig.SetFormat((v) => $"{v}%");
    // 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
        }
    }
    SetDataViewsBuilder<TDataViewsBuilder>() : CollectionConfigBuilder<TEntityType>
    collectionConfig.SetDataViewsBuilder<PersonDataViewsBuilder>();
    SetDataViewsBuilder(Type dataViewsBuilderType) : CollectionConfigBuilder<TEntityType>
    collectionConfig.SetDataViewsBuilder(typeof(PersonDataViewsBuilder));
    SetDataViewsBuilder(DataViewsBuilder<TEntityType> dataViewsBuilder) : CollectionConfigBuilder<TEntityType>
    collectionConfig.SetDataViewsBuilder(new PersonDataViewsBuilder());
    Fixed issue when filtering collections by a property of type DateTime #219
    • Fixed an issue in list views when using fields that have the same name #220

    • Fixed builder for Core sections tree registration #216

    • Added support for EF Core data access

    • Async APIs

    • Fixed bulk actions for collections #215

    • Replace deprecated PagedResult with PagedModel #214.

    • Fixed translation issue when using localization files.

    • Fixed items pagination in Entity Picker.

    • Removed obsolete code scheduled for removal in V17.

    • Updated the cards UI adopting a slimmer appearance #184

    • Fixed card counter caused by a regression in 17.0.0 #212

    • Fixed a top padding issue with child collections #180

    • Fixed a regression impacting child collections #213

    • Added additional localization support for editor fields labels and descriptions, collection filters, cards, data views #208

    • Fixed entity menu actions display #207

    • Enable columns sorting for collections list view #205

    • Fixed the visibility of entity actions when entity is new

    • Restored container menu actions

    • Fixed handling of entities with key different than Integer causing actions visibility issues

    • Final release to support Umbraco 17

    • Compatibility update for Umbraco 17.0.0-rc4 and Swashbuckle 10

    • Compatibility update for Umbraco 17.0.0-rc1

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

    If you are upgrading to a new major version, check the breaking changes in the Version Specific Upgrade Notes article.

    Release History

    17.2.2 (May 1st 2026)

    UI Builder issue tracker
    #221

    (April 16th 2026)

    (April 7th 2026)

    (March 5th 2026)

    (February 27th 2026)

    (January 28th 2026)

    (December 18th 2025)

    (December 12th 2025)

    (December 11th 2025)

    17.0.0 (November 27th 2025)

    17.0.0-rc2 (November 25th 2025)

    17.0.0-rc1 (November 3rd 2025)

    Legacy Release Notes

    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.

    Section View

    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.

    Tree View

    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.

    Dashboard View

    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.

    The editor is where the main content editing occurs. It is structured using tabs, fieldsets, and fields. Tabs organize different sections of content, and fieldsets group related fields together. Each field represents a specific piece of data, such as a text box or an image upload.

    Workspace Views are additional functionality that can be added to an editor. They provide extra features based on the content of the item being edited. For instance, a media Workspace View might allow you to resize or crop an image directly from the editor.

    Tabs are used to organize content within the editor, allowing users to switch between different sections of a content item. For example, one tab might contain the general settings, while another contains media or advanced options.

    A menu item represents an action within the context of a tree node or a list item. It is a clickable item that triggers specific tasks, such as deleting or editing an item.

    Bulk actions allow you to perform an operation on multiple items in the list view at once. For example, you might use a bulk action to delete multiple content items or update their status in a single step.

    Retrieve Child Collections

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

    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.

    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.

    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.

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

    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

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

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

    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.

    Filterable Properties

    Defining Filterable Properties

    Defining filterable properties is controlled via the Collections settings.

    Using the AddFilterableProperty() Method

    Adds a given property to the filterable properties collection.

    Method Syntax

    AddFilterableProperty(Lambda filterablePropertyExpression, Lambda filterConfig = null) : CollectionConfigBuilder<TEntityType>

    Example

    collectionConfig.AddFilterableProperty(p => p.FirstName, filterConfig => filterConfig 
        // ...
    );

    Changing the Label of a Filterable Property

    Using the SetLabel() Method

    Sets the label for the filterable property.

    Method Syntax

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

    Example

    filterConfig.SetLabel("First Name");

    Adding a Description to a Filterable Property

    Using the SetDescription() Method

    Sets a description for the filterable property.

    Method Syntax

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

    Example

    filterConfig.SetDescription("The first name of the person");

    Defining Basic Options for a Filterable Property

    Using the SetOptions() Method

    Defines basic options for a filterable property.

    Method Syntax

    SetOptions(IDictionary<TValueType, string> options) : FilterablePropertyConfigBuilder<TEntityType, TValueType>

    Example

    filterConfig.SetOptions(new Dictionary<string, string> {
        { "Option1", "Option One" },
        { "Option2", "Option Two" }
    });

    Defining Options with Custom Compare Clauses for a Filterable Property

    Using the AddOption() Method

    Defines options with custom comparison clauses for a filterable property.

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

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

    Async APIs

    Learn about Async API Changes

    UI Builder 17.1.0 adds EF Core support, converting the data access pipeline to async-first. This update impacts API controllers, services, repositories, and database extensions. Existing sync methods are now obsolete and scheduled for removal in V19.

    This migration handled the following:

    • Every existing sync method gets an async counterpart with an Async suffix.

    • Sync methods are marked [Obsolete("Scheduled for removal in v19")].

    • Sync methods are rewired to delegate to async via .ConfigureAwait(false).GetAwaiter().GetResult().

    • All async methods accept an optional CancellationToken cancellationToken = default as the last parameter.

    Version
    Status

    If you have a custom repository extending Repository<TEntity, TId> (or use the new EFCoreRepository<TEntity, TId>):

    1. Implement all new *ImplAsync abstract methods.

    2. Migrate callers from sync to async methods.

    3. Pass CancellationToken through the call chain.

    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.

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

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

    Child Collections

    Configuring child collections in Umbraco UI Builder.

    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.

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

    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.

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

    Accesses the list view configuration for the specified collection.

    Adds a specified property to the list view.

    Sets the heading for a field in the list view.

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

    EF Core Events

    Configuring event handlers for EF Core in Umbraco UI Builder.

    Umbraco UI Builder now supports EF Core. It publishes specific notifications, allowing you to modify queries before and after they are built.

    These are the EF Core equivalents of the NPoco SqlQueryBuildingNotification and SqlQueryBuiltNotification.

    Umbraco UI Builder follows the for event registration.

    To define a notification event handler for the target event, please check the section.

    Triggers when the default EF Core repository is preparing a query. The notification provides access to the IQueryable

    #202
    #201
    #196
    17.2.1
    17.2.0
    17.1.0
    17.0.5
    17.0.4
    17.0.3
    17.0.2
    17.0.1

    Editor

    Workspace Views

    Tabs

    Menu Item

    Bulk Action

    Collection View
    Editor
    Workspace Views
    Tabs
    Menu Item
    Bulk Action
    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.

  • Child Repositories

    No

    Color

    The color of the card.

    No

    Suffix

    The suffix displayed after the card value.

    No

    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

    Adding a Custom Card to a Collection

    Using the AddCard() Method

    Method Syntax

    Example

    Using the AddCard(Type cardType) Method

    Method Syntax

    Example

    An icon displayed in the card.

    Method Syntax

    Example

    Configuring the Mode of a Filterable Property

    Using the SetMode() Method

    Method Syntax

    Example

    The sync *Impl methods still work but will be removed in version 19.

    Version 17

    Sync methods marked [Obsolete], async methods added.

    Version 19

    Sync methods removed.

    Deprecation Timeline

    Migration Guide for Custom Repository Implementations

    Method Syntax

    Example

    Using the SetValueMapper(Type mapperType) Method

    Method Syntax

    Example

    Using the SetValueMapper(Mapper mapper) Method

    Method Syntax

    Example

    Method Syntax

    Example

    Configuring a Child Collection

    Basics

    Method Syntax

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

    Sets the view component for the list view field.

    Sets the view component for the list view field.

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

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

    Configuring a List View

    Using the ListView() Method

    Method Syntax

    Example

    Adding a Field to the List View

    Using the AddField() Method

    Method Syntax

    Example

    Changing the Heading of a Field

    Using the SetHeading() Method

    Method Syntax

    Example

    Formatting the Value of a Field

    Using the SetFormat() Method

    Method Syntax

    Example

    Setting the View of a Field

    Collection
    A collection list view

    Using the SetView() Method

    Method Syntax

    Example

    Using the SetView<TView>() Method

    Method Syntax

    Example

    Setting the Visibility of a Field

    Using the SetVisibility() Method

    Method Syntax

    Example

    Changing the Page Size

    Using the SetPageSize Method

    Method Syntax

    Example

    , where clause, order by expression, collection alias, and entity type. You can modify these to customize the query before execution.

    Triggers when the default EF Core repository has completed building a query. The notification contains the final IQueryable, where clause, and order by expressions that were used to generate the query.

    Register EF Core query event handlers the same way you would other Umbraco notifications:

    Registering Event Handlers

    Using the EFCoreQueryBuildingNotification

    Umbraco Notification mechanism
    Registering Event Handlers

    Example

    Using the EFCoreQueryBuiltNotification

    Example

    Registering Event Handlers

    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);
        }
    }
    AddCard() : CollectionConfigBuilder<TEntityType>
    collectionConfig.AddCard<AvgPersonAgeCard>();
    AddCard(Type cardType) : CollectionConfigBuilder<TEntityType>
    collectionConfig.AddCard(typeof(AvgPersonAgeCard));
    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);
    // Before (v16)
    protected override TEntity GetImpl(TId id)
    {
        return _myDataSource.Get(id);
    }
    
    // After (v17+)
    protected override async Task<TEntity> GetImplAsync(TId id, CancellationToken cancellationToken)
    {
        return await _myDataSource.GetAsync(id, cancellationToken);
    }
    SetValueMapper<TMapperType>() : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.SetValueMapper<MyValueMapper>();
    SetValueMapper(Type mapperType) : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.SetValueMapper(typeof(MyValueMapper));
    SetValueMapper(Mapper mapper) : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.SetValueMapper(new MyValueMapper());
    AddChildCollection<TChildEntityType>(Lambda idFieldExpression, Lambda fkFieldExpression, string nameSingular, string namePlural, string description, string iconSingular, string iconPlural, Lambda childCollectionConfig = null) : ChildCollectionConfigBuilder<TEntityType>
    collectionConfig.AddChildCollection<Child>(c => c.Id, c => c.ParentId, "Child", "Children", "A collection of children", "icon-umb-users", "icon-umb-users", childCollectionConfig => {
        ...
    });
    collectionConfig.AddAllDataView(string? label)
    ListView(Lambda listViewConfig = null) : ListViewConfigBuilder<TEntityType>
    collectionConfig.ListView(listViewConfig => {
        ...
    });
    AddField(Lambda propertyExpression, Lambda fieldConfig = null) : ListViewFieldConfigBuilder<TEntityType, TValueType>
    listViewConfig.AddField(p => p.FirstName, fieldConfig => {
        ...
    });
    SetHeading(string heading) : ListViewFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.SetHeading("First Name");
    SetFormat(Lambda formatExpression) : ListViewFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.SetFormat((v, p) => $"{v} years old");
    SetView(string viewComponentName) : ListViewFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.SetView("ImageFieldView");
    SetView<TView>() : ListViewFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.SetView<ImageFieldView>();
    SetVisibility(Predicate<ListViewFieldVisibilityContext> visibilityExpression) : ListViewFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.SetVisibility(ctx => ctx.UserGroups.Any(x => x.Alias == "editor"));
    SetPageSize(int pageSize) : ListViewConfigBuilder<TEntityType>
    listViewConfig.SetPageSize(20);
    public class MyEFCoreQueryBuildingHandler : INotificationHandler<EFCoreQueryBuildingNotification>
    {
        public void Handle(EFCoreQueryBuildingNotification notification)
        {
            // Access query properties
            var collectionAlias = notification.Args.CollectionAlias;
            var entityType = notification.Args.EntityType;
    
            // Modify the IQueryable directly
            // notification.Args.Query = ...
        }
    }
    public class MyEFCoreQueryBuiltHandler : INotificationHandler<EFCoreQueryBuiltNotification>
    {
        public void Handle(EFCoreQueryBuiltNotification notification)
        {
            // Inspect or further modify the built query
            var query = notification.Args.Query;
        }
    }
    builder.CreateUmbracoBuilder()
        .AddBackOffice()
        .AddWebsite()
        .AddDeliveryApi()
        .AddComposers()
        .AddNotificationHandler<EFCoreQueryBuildingNotification, MyEFCoreQueryBuildingHandler>()
        .AddNotificationHandler<EFCoreQueryBuiltNotification, MyEFCoreQueryBuiltHandler>()
        .Build();

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

    Dashboards

    Defining a Dashboard

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

    Using the AddDashboard() Method

    Adds a dashboard with the specified name.

    Method Syntax

    AddDashboard(string name, Lambda dashboardConfig = null) : DashboardConfigBuilder

    Example

    sectionConfig.AddDashboard("Team", dashboardConfig => {
        ...
    });

    Using the AddDashboardBefore() Method

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

    Method Syntax

    AddDashboardBefore(string beforeAlias, string name, Lambda dashboardConfig = null) : DashboardConfigBuilder

    Example

    sectionConfig.AddDashboardBefore("contentIntro", "Team", dashboardConfig => {
        ...
    });

    Using the AddDashboardAfter() Method

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

    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.

    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.

    Defines visibility rules for the dashboard.

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

    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.

    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.

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

    Tree with Settings folder

    Defining a Folder

    To define a folder, use one of the AddFolder methods on a Tree 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

    AddFolder(string name, Lambda folderConfig = null) : FolderConfigBuilder

    Example

    treeConfig.AddFolder("Settings", folderConfig => {
        ...
    });

    Using the AddFolder() Method with Custom Icon

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

    Method Syntax

    AddFolder(string name, string icon, Lambda folderConfig = null) : FolderConfigBuilder

    Example

    treeConfig.AddFolder("Settings", "icon-settings", folderConfig => {
        ...
    });

    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.

    Sets a custom alias for a folder.

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

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

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

    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.

    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.

    Localization

    Using the available context to handle localization for an UI Builder collection

    The localization context enables developers to use multilingual collection names and descriptions in fluent configurations. It also supports translations for actions, context apps, dashboards, sections, and trees.

    To enable localization, prefix the input string with the # character.

    Upon character identification in the fluent configuration, the localization context will attempt to lookup a matching localized string using two services available. If no matching record is found, it will default to the provided string value.

    Supported areas:

    • Collections - Name and Description properties.

    • Data Views - only if the key is in a localization resource, not in the translation dictionary (e.g. ).

    • Collection filters - Label and Description properties.

    • Cards

    • Editor fields - Label and Description field properties.

    • Fieldsets names

    • Actions names

    • Context Apps names

    • Dashboards names

    • Sections names

    The localization context uses two abstractions to provide localization options.

    The first uses the Umbraco translations dictionary to retrieve a value based on a provided key.

    The second uses the CMS ILocalizedTextService to retrieve a value based on area and alias. These values are supplied in the collection's fluent configuration, separated by an underscore _ from the localization resources.

    For a Students collection, use the following fluent configuration:

    Alternatively, you can use the lowercase version:

    Define the translation in your localization dictionary file:

    For a custom section, use the following configuration:

    When the implemented localization does not cover a specific area, you can update it directly in the fluent configuration by using the LocalizationContext.

    For example, this custom data view:

    Virtual Sub Trees

    Configuring virtual sub trees in Umbraco UI Builder.

    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.

    Virtual sub tree injected into a Commerce store tree

    Defining Virtual SubTrees

    Use the AddVirtualSubTree methods of a WithTreeConfigBuilder 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

    AddVirtualSubTree(string sectionAlias, string treeAlias, Lambda visibilityExpression, Lambda virtualSubTreeConfig = null) : VirtualSubTreeConfigBuilder

    Example

    withTreeConfig.AddVirtualSubTree(ctx => ctx.Source.Id == 1056, contextAppConfig => {
        ...
    });

    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

    AddVirtualSubTreeBefore(string sectionAlias, string treeAlias, Lambda visibilityExpression, Lambda matchExpression, Lambda virtualSubTreeConfig = null) : VirtualSubTreeConfigBuilder

    Example

    withTreeConfig.AddVirtualSubTreeBefore(ctx => ctx.Source.Id == 1056, treeNode => treeNode.Name == "Settings", contextAppConfig => {
        ...
    });

    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.

    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.

    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":

    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.

    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.

    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.

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

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

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

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

    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.

    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.

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

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

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

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

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

    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.

    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 generic argument specifies the return type for the action. For more details, see the section below.

    {% hint style="info" %} 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. {% endhint %}

    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.

    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.

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

    Actions are added via the settings.

    Adds an action of the specified type to the collection.

    Adds an action of the specified type to the collection.

    Adds the given action to the collection.

    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.

    Umbraco UI Builder uses PetaPoco as its default persistence layer.

    In this section, you will create a Person table to store data.

    To create a Person table, run the following script in SQL Server Management Studio (SSMS).

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

    With the database table created, define the Person

    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.

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

    Konstrukt
    Umbraco UI Builder

    Method Syntax

    Example

    Setting a Custom Dashboard Alias

    Using the SetAlias() Method

    Method Syntax

    Example

    Controlling Dashboard Visibility

    Using the SetVisibility() Method

    Method Syntax

    Example

    Assigning a Collection to a Dashboard

    Using the SetCollection<>() Method

    Method Syntax

    Example

    Using the SetCollection<>() Method with Custom Icons

    Method Syntax

    Example

    Collections
    Collections

    Using the SetAlias() Method

    Method Syntax

    Example

    Changing a Folder Icon Color

    Using the SetIconColor() Method

    Method Syntax

    Example

    Adding a Sub-Folder To a Folder

    Using the AddFolder() Method for Sub-Folders

    Method Syntax

    Example

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

    Method Syntax

    Example

    Adding a Collection to a Folder

    Using the AddCollection<>() Method

    Method Syntax

    Example

    Using the AddCollection<>() Method with Custom Icons

    Method Syntax

    Example

    Collections
    Collections

    Localization Services

    Example

    Localizing a Collection

    Localizing a Section

    Localizing an additional area

    additional localization
    collection_translation
    collection_name
    section_name

    Method Syntax

    Example

    Control the Virtual SubTrees Inject Location

    Example: Filter Injection by Document Type

    Control the Position of the injected Virtual SubTrees

    Configuring a Virtual SubTree

    Inject Virtual Subtrees into Third-Party Trees

    Trees
    Umbraco Commerce

    Overriding Action Visibility

    Using the AddAction<TMenuActionType>() Method

    Method Syntax

    Example

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

    Method Syntax

    Example

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

    Method Syntax

    Example

    Action Visibility Context

    ActionType

    ContainerMenu

    EntityMenu

    Bulk

    Row

    Save

    UserGroups

    Collections
    Container Menu
    Entity Menu
    Bulk Actions
    Row Actions
    Save Actions

    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

    Controlling the Action Result

    Capturing Settings for an Action

    Adding an Action to a Collection

    Using the AddAction<TMenuActionType>() Method

    Method Syntax

    Example

    Using the AddAction(Type actionType) Method

    Method Syntax

    Example

    Using the AddAction(IAction action) Method

    Method Syntax

    Example

    Controlling the Action Result
    Collection Editors
    Collections
    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 => {
            ...
        }
    );
    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 => {
            ...
        }
    );
    treeConfig.AddCollection<Student>(x => x.Id, "#CollectionStudents", "#CollectionStudents", "A list of students", "icon-umb-members", "icon-umb-members", collectionConfig =>
    {
        ...
    });
    treeConfig.AddCollection<Student>(x => x.Id, "#collection_students", "#collection_students", "A list of students", "icon-umb-members", "icon-umb-members", collectionConfig =>
    {
        ...
    });
    import type { UmbLocalizationDictionary } from "@umbraco-cms/backoffice/localization-api";
    
    export default {
        collection: {
            students: "Studerende"
        }
        ...
    }
    .AddSection("#UmbracoTraining", sectionConfig =>
    {
        ...
    }
    public class CommentStatusDataViewsBuilder : DataViewsBuilder<Comment>
    {
        private readonly LocalizationContext _localizationContext;
        public CommentStatusDataViewsBuilder(LocalizationContext localizationContext)
        {
            _localizationContext = localizationContext;
        }
    
        public override IEnumerable<DataViewSummary> GetDataViews()
        {
            yield return new DataViewSummary
            {
                Name = _localizationContext.TryLocalize("#dataView_All", out string localizedText) ? localizedText : string.Empty,
                Alias = "all",
                Group = "Status"
            };
            
            foreach (var val in Enum.GetValues<CommentStatus>())
            {
                yield return new DataViewSummary
                {
                    Name = val.ToString(),
                    Alias = val.ToString().ToLower(),
                    Group = "Status"
                };
            }
        }
    }
    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>();
    AddAction<TMenuActionType>(Lambda actionConfig = null) : CollectionConfigBuilder<TEntityType>
    collectionConfig.AddAction<ExportMenuAction>(actionConfig => actionConfig
        .SetVisibility(x => x.ActionType == ActionType.Bulk 
            || x.ActionType == ActionType.Row)
    );
    AddAction(Type actionType, Lambda actionConfig = null) : CollectionConfigBuilder<TEntityType>
    collectionConfig.AddAction(typeof(ExportMenuAction), actionConfig => actionConfig
        .SetVisibility(x => x.ActionType == ActionType.Bulk 
            || x.ActionType == ActionType.Row)
    );
    AddAction(IAction action, Lambda actionConfig = null) : CollectionConfigBuilder<TEntityType>
    collectionConfig.AddAction(action, actionConfig => actionConfig
        .SetVisibility(x => x.ActionType == ActionType.Bulk 
            || x.ActionType == ActionType.Row)
    );
    // 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; }
    }
    AddAction<TMenuActionType>() : CollectionConfigBuilder<TEntityType>
    collectionConfig.AddAction<ExportMenuAction>();
    AddAction(Type actionType) : CollectionConfigBuilder<TEntityType>
    collectionConfig.AddAction(actionType);
    AddAction(IAction action) : CollectionConfigBuilder<TEntityType>
    collectionConfig.AddAction(action);
    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:

    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.

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

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

    2. Locate the CreateUmbracoBuilder() method.

    3. Add AddUIBuilder before AddComposers().

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

    After defining the configuration, compile and run your project. To access the newly defined section, you need to give permission to the backoffice user account:

    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

    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.

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

    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

    Setting Up the Model

    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; }
    }
    builder.CreateUmbracoBuilder()
        .AddBackOffice()
        .AddWebsite()
        .AddDeliveryApi()
        .AddComposers()
        .AddUIBuilder(cfg => {
            // Apply your configuration here
        })
        .Build();
    ...
    .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")
                            )
                        )
                    )
                )
            )
        );
    
    })
    ...

    Configure Umbraco UI Builder

    You can configure Umbraco UI Builder either through a Composer or by using the AddUIBuilder extension method in Program.cs.

    Configuring via Program.cs

    Example Configuration

    Accessing the Umbraco Backoffice

    Summary

    Umbraco.UIBuilder.Infrastructure

    Konstrukt.Web

    Umbraco.UIBuilder.Web

    Konstrukt.Web.UI

    Umbraco.UIBuilder.Web.StaticAssets

    Konstrukt.Startup

    Umbraco.UIBuilder.Startup

    Konstrukt

    Umbraco.UIBuilder

    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.

    Update all Konstrukt references to their Umbraco UI Builder alternatives. Ensure you update any Views/Partials that also reference these. See the Key Changes section for reference.

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

    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.

    Konstrukt.Core

    Umbraco.UIBuilder.Core

    Key Changes

    Project, Package, and Namespace changes

    Konstrukt.Infrastructure

    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"
      }
    }

    Code and UI Changes

    C# Class Changes
    • Namespace changes as mentioned above.

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

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

    • All Konstrukt

    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

    Step 2: Update Namespaces and Entity Names

    Step 3: Update Configuration

    Step 4: Finalize the Migration

    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.

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

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

    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.

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

    Context app visibility is controlled by a delegate that takes a ContextAppVisibilityContext instance. This method contains a Source property which holds a reference to the source object that the 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.

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

    Context apps can consist of one or more collections. If a context app contains multiple collections, the collection list views will be displayed in tabs within the context app.

    Adds a collection to the current context app with the specified names, descriptions, and default icons. Each collection requires an ID field and a foreign key field, linking to Umbraco node UDI values. For more details, see the article.

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

    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.

    Sections

    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

    AddSection(string name, Lambda sectionConfig = null) : SectionConfigBuilder

    Example

    config.AddSection("Repositories", sectionConfig => {
        ...
    });

    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

    AddSectionBefore(string beforeAlias, string name, Lambda sectionConfig = null) : SectionConfigBuilder

    Example

    config.AddSectionBefore("settings", "Repositories", sectionConfig => {
        ...
    });

    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.

    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.

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

    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.

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

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

    You can extend existing sections by adding Umbraco UI Builder trees and dashboards, context apps, and virtual subtrees. This can be done by calling the WithSection method on the root-level UIBuilderConfigBuilder instance.

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

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

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

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

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

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

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

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

    Related Collections

    Configuring Many-to-Many Relationships in Umbraco UI Builder

    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:

    To define a related collection, follow these two steps:

    1. Add the collection definition

    2. Add the related collection entity picker and definition

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

    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.

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

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

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

    Adds a new related collection to the current parent entity.

    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.

    // 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)
        {
            ...
        }
    }

    {% hint style="info" %} 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. {% endhint %}

    Changing the Repository Implementation of a Collection

    Using the SetRepositoryType() Method

    Assign a custom repository type to a collection.

    Method Syntax

    SetRepositoryType<TRepositoryType>() : CollectionConfigBuilder<TEntityType>

    Example

    collectionConfig.SetRepositoryType<PersonRepositoryType>();

    Using the SetRepositoryType(Type repositoryType) Method

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

    Method Syntax

    SetRepositoryType(Type repositoryType) : CollectionConfigBuilder<TEntityType>

    Example

    collectionConfig.SetRepositoryType(typeof(PersonRepositoryType));

    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.

    Creates a repository for the given entity type. Umbraco UI Builder will search the configuration for the first section/collection with a configuration for the given entity type. Then it will use that as a repository configuration.

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

    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 Umbraco Notification mechanism for event registration.

    Define a notification event handler for the target event:

    public class MyEntitySavingEventHandler :  INotificationHandler<EntitySavingNotification> {
    
        public void Handle(EntitySavingNotification notification)
        {
            // Handle the event here
        }
    
    }

    Register the event handler in Program.cs:

    builder.CreateUmbracoBuilder()
        .AddBackOffice()
        .AddWebsite()
        .AddDeliveryApi()
        .AddComposers()
        .AddNotificationHandler<EntitySavingNotification, MyEntitySavingEventHandler>()
        .Build();

    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.

    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.

    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.

    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.

    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.

    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.

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

    Examples: IKonstruktRepository -> IRepository

  • Exceptions:

    • KonstruktConfig and KonstruktConfigBuilder now use a UIBuilder prefix.

    • AddKonstrukt extension for IUmbracoBuilder is now AddUIBuilder

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

    Method Syntax

    Example

    Using the AddContextAppAfter() Method

    Method Syntax

    Example

    Using the AddContextAppAfter() Method with a Custom Icon

    Method Syntax

    Example

    Changing a Context App Alias

    Using the SetAlias() Method

    Method Syntax

    Example

    Changing a Context App Icon Color

    Using the SetIconColor() Method

    Method Syntax

    Example

    Changing Context App Visibility

    Using the SetIconColor() Method

    Method Syntax

    Example

    Adding a Collection to a Context App

    Using the AddCollection<>() Method

    Method Syntax

    Example

    Using the AddCollection<>() Method with Custom Icon

    Method Syntax

    Example

    Collections
    Collections

    Method Syntax

    Example

    Customizing the Section Alias

    Setting a Custom Alias with SetAlias() Method

    Method Syntax

    Example

    Configuring the Section Tree

    Using the Tree() Method for Configuration

    Method Syntax

    Example

    Adding Dashboards to the Section

    Adding a Dashboard with the AddDashboard() Method

    Method Syntax

    Example

    Using AddDashboardBefore() to Place a Dashboard

    Method Syntax

    Example

    Using AddDashboardAfter() to Place a Dashboard

    Method Syntax

    Example

    Extending Existing Sections

    Extending an Existing Section with WithSection()

    Method Syntax

    Example

    Adding Trees to an Existing Section

    Using the AddTree() Method

    Method Syntax

    Example

    Grouping Trees with AddTree() Method

    Method Syntax

    Example

    Adding a Tree Before or After an Existing Tree

    Using AddTreeBefore() to Position a Tree

    Method Syntax

    Example

    Using AddTreeAfter() to Position a Tree

    Method Syntax

    Example

    Adding a Dashboard to an Existing Section

    Using the AddDashboard() Method

    Method Syntax

    Example

    Using the AddDashboardBefore() Method

    Method Syntax

    Example

    Using the AddDashboardAfter() Method

    Method Syntax

    Example

    Trees
    Dashboards
    Dashboards
    Dashboards
    Trees
    Trees
    Trees
    Trees
    Dashboards
    Dashboards
    Dashboards

    Defining a Related Collection

    Collection definition

    Using the AddRelatedCollection() Method

    Method Syntax

    Example

    Configuring a Related Collection Entity Picker

    Using the AddRelatedCollectionPickerField() Method

    Method Syntax

    Example

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

    Defining Repository Methods

    Using the GetRelationsByParentIdImpl<>() Method

    Method Syntax

    Example

    Using the SaveRelationImpl<>() Method

    Method Syntax

    Example

    Using the GetRepository<TEntity, TId>() Method

    Method Syntax

    Example

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

    Method Syntax

    Example

    Example

    Using the EntitySavedNotification()

    Example

    Using the EntityDeletingNotification()

    Example

    Using the EntityDeletedNotification()

    Example

    Using the SqlQueryBuildingNotification()

    Example

    Using the SqlQueryBuiltNotification()

    Example

    Repository Events Validation

    Example

    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 => {
        ...
    });
    SetAlias(string alias) : ContextAppConfigBuilder
    contextAppConfig.SetAlias("comments");
    SetIconColor(string color) : ContextAppConfigBuilder
    contextAppConfig.SetIconColor("blue");
    SetVisibility(Func<ContextAppVisibilityContext, bool> visibilityExpression) : ContextAppConfigBuilder
    contextAppConfig.SetVisibility(appCtx => appCtx.Source is IContent content && content.ContentType.Alias == "blogPost");
    AddCollection<TEntityType>(
        Lambda idFieldExpression, 
        Lambda fkFieldExpression, 
        string nameSingular, 
        string namePlural, 
        string description, 
        Lambda collectionConfig = null
    ) : ContextAppConfigBuilder
    contextAppConfig.AddCollection<Comment>(
        p => p.Id, 
        p => "Comment", 
        "Comments", 
        "A collection of comments", 
        collectionConfig => {
            // Collection configuration here
        }
    );
    AddCollection<TEntityType>(
        Lambda idFieldExpression, 
        Lambda fkFieldExpression, 
        string nameSingular, 
        string namePlural, 
        string description, 
        string iconSingular, 
        string iconPlural, 
        Lambda collectionConfig = null
    ) : ContextAppConfigBuilder
    contextAppConfig.AddCollection<Comment>(
        p => p.Id, 
        "Comment", 
        "Comments", 
        "A collection of comments", 
        "icon-chat", 
        "icon-chat", 
        collectionConfig => {
            // Collection configuration here
        }
    );
    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 => {
        ...
    });
    [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; }
    }
    AddRelatedCollection<TEntityType, TRelatedEntityType, TJunctionEntityType>(Expression<Func<TRelatedEntityType, object>> idPropertyExpression, string nameSingular, string namePlural, Action<RelationConfigBuilder<TBuilder, TEntity, TRelatedEntityType, TJunctionEntityType>> relationConfig)
    collectionConfig.AddRelatedCollection<Student, Course, StudentCourse>(x => x.Id, "Student Course", "Students Courses", relationConfig =>
    {
        relationConfig
            .SetAlias("studentsCourses")
            .SetJunction<StudentCourse>(x => x.StudentId, y => y.CourseId);
    });
    AddRelatedCollectionPickerField<TValueType>(string alias, string dataTypeName, string label)
    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");
            }));
    });
    IEnumerable<StudentCourse> GetRelationsByParentIdImpl<StudentCourse>(int parentId, string relationAlias)
    {
        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;
    }
    StudentCourse SaveRelationImpl<StudentCourse>(StudentCourse entity)
    {
        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;
    }
    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");
        }
    }
    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"));
            }
        }
    
    }

    EF Core Repositories

    Configuring Entity Framework Core in Umbraco UI Builder.

    Umbraco UI Builder supports Entity Framework Core (EF Core) as an alternative data access strategy to the default NPoco-based repository. When enabled, collections use EF Core for all CRUD operations, including querying, pagination, saving, and deleting entities.

    EF Core support is available from Umbraco UI Builder 17.1.

    Configuration

    EF Core support is toggled via a feature flag in your application's configuration. When enabled, all registered collections will automatically switch to the EF Core-based implementation.

    To enable EF Core, add the following to your appsettings.json:

    {
      "Umbraco": {
        "UIBuilder": {
          "FeatureManagement": {
            "UseEFCore": true
          }
        }
      }
    }

    When UseEFCore is true, the built-in EF Core repository is used instead of the NPoco-based one. Collections with a custom repository type set via SetRepositoryType are not affected by this flag.

    When using EF Core, your entity models use standard data annotation attributes from System.ComponentModel.DataAnnotations and System.ComponentModel.DataAnnotations.Schema instead of NPoco attributes.

    In comparison with the NPoco-based model:

    Umbraco UI Builder provides a built-in DbContext that automatically configures entity models at runtime based on your collection configuration. This context is registered with the DI container during startup and uses Umbraco's database provider.

    The UIBuilderDbContext automatically:

    • Registers entity types from all configured collections.

    • Configures primary keys based on the collection's IdProperty.

    • Configures junction entities with composite keys for related collections.

    You do not need to create your own DbContext for the default repository to work. The UIBuilderDbContext is configured for you.

    Collection configuration remains the same as with NPoco. The fluent API is unchanged:

    For advanced scenarios, use the ConfigureEFCore() method to customize the EF Core model for a collection. This gives you access to the ModelBuilder and the CollectionConfig to configure relationships, indexes, or table mappings.

    For configuring child or related collections, the fluent configuration remains the same:

    For full control over data access, create a custom repository that extends EFCoreRepository<TEntity, TId>. This base class provides access to the UIBuilderDbContext and a typed DbSet<TEntity>, while inheriting event lifecycle, encryption, and soft-delete support from Repository<TEntity, TId>.

    To assign your custom EF Core repository to a collection, use the SetRepositoryType method:

    All standard entity lifecycle events work the same way regardless of the data access strategy:

    • EntitySavingNotification / EntitySavedNotification

    • EntityDeletingNotification / EntityDeletedNotification

    When using EF Core, UI Builder publishes EF Core-specific query notifications. See the documentation for more details.

    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.

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

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

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

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

    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.

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

    Accesses the editor configuration for the specified collection.

    Adds a tab to the editor.

    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.

    Configures the sidebar for the tab.

    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.

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

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

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

    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

    Applies any custom EF Core model configuration provided via ConfigureEFCore().

    The NPoco-based repository remains the default when the feature flag is not set or is set to false. EF Core support is intended to become the default in a future release, at which point the NPoco implementation will be deprecated.

    Database Setup

    Defining Entity Models

    UIBuilderDbContext

    Collections Configuration

    Method Syntax

    Example

    Custom EF Core Repositories

    Custom repositories set via SetRepositoryType are used regardless of the UseEFCore feature flag. The feature flag only controls the default repository implementation.

    Repository Events

    EF Core Events

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

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

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

    This method changes the color of the tree’s icon. The available options are black, green, yellow, orange, blue, or red.

    {% hint style="warning" %} Only trees in existing sections have an icon. Trees in Umbraco UI Builder sections display the tree contents directly. {% endhint %}

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

    {% hint style="warning" %} Only trees in Umbraco UI Builder sections support groups. {% endhint %}

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

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

    This method adds a collection to the current tree or group, specifying its names, descriptions, and default icons. The ID property must be defined. For more details, see the Collections article.

    This method adds a collection to the current tree or group, specifying its names, descriptions, and custom icons. The ID property must be defined. For more details, see the Collections article.

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

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

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

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

    This method adds a context app with the specified name and default icon before the specified context app alias. For more information, see the Context Apps article.

    This method adds a context app with the specified name and custom icon before the specified context app alias. For more information, see the Context Apps article.

    This method adds a context app with the specified name and default icon after the specified context app alias. For more information, see the Context Apps article.

    This method adds a context app with the specified name and custom icon after the specified context app alias. For more information, see the Context Apps article.

    Configuring a Umbraco UI Builder Section Tree

    Using the Tree() Method

    Method Syntax

    Example

    Adding a Tree to an Existing Section

    Using the AddTree() method

    Section
    WithSection
    Tree

    Method Syntax

    Example

    Grouping Trees with AddTree() Method

    Method Syntax

    Example

    Using AddTreeBefore() to Position a Tree

    Method Syntax

    Example

    Using AddTreeAfter() to Position a Tree

    Method Syntax

    Example

    Changing the Tree Icon Color

    Using the SetIconColor() Method

    Method Syntax

    Example

    Adding a Group to a Tree

    Using the AddGroup() Method

    Method Syntax

    Example

    Adding a Folder to a Tree or Group

    Using the AddFolder() Method

    Method Syntax

    Example

    Using the AddFolder() Method with Custom Icon

    Method Syntax

    Example

    Adding a Collection to a Tree or Group

    Using the AddCollection<>() Method

    Method Syntax

    Example

    Using the AddCollection<>() Method with Icons

    Method Syntax

    Example

    Extending an Existing Tree

    Using the WithTree() Method

    Method Syntax

    Example

    Adding a Context App to an Existing Tree

    Using the AddContextApp() Method

    Method Syntax

    Example

    Using the AddContextApp() Method with Custom Icon

    Method Syntax

    Example

    Adding a Context App Before or After Another Context App

    Using the AddContextApp() Method Before Another Context App

    Method Syntax

    Example

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

    Method Syntax

    Example

    Using the AddContextApp() Method After Another Context App

    Method Syntax

    Example

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

    Method Syntax

    Example

    Determines the visibility of the tab at runtime.

    Adds a fieldset to a tab.

    Determines the visibility of a fieldset at runtime.

    Adds a property field to the editor.

    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.

    Sets a custom label for a field.

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

    Hides the field label.

    Adds a description to the field.

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

    Assigns an Umbraco Data Type by name or ID.

    Sets a static default value.

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

    Marks a field as required.

    Applies a regular expression for field validation.

    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.

    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.

    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.

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

    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.

    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.

    Controls field visibility at runtime.

    Configuring an Editor

    Using the Editor() Method

    Method Syntax

    Example

    Adding a Tab to an Editor

    Using the AddTab() Method

    Method Syntax

    Example

    Configuring a Sidebar to a Tab

    Using the Sidebar() Method

    Method Syntax

    Example

    Collection
    A collection editor

    Setting the Visibility of a Tab

    Using the SetVisibility() Method for Tabs

    Method Syntax

    Example

    Adding a Fieldset to a Tab

    Using the AddFieldset() Method

    Method Syntax

    Example

    Setting the Visibility of a Fieldset

    Using the SetVisibility() Method for Fieldsets

    Method Syntax

    Example

    Adding a Field to a Fieldset

    Using the AddField() Method

    Method Syntax

    Example

    Changing the Label of a Field

    Using the SetLabel() Method

    Method Syntax

    Example

    Hiding the Label of a Field

    Using the HideLabel() Method

    Method Syntax

    Example

    Adding a Description to a Field

    Using the SetDescription() Method

    Method Syntax

    Example

    Changing the Data Type of a Field

    Using the SetDataType() Method

    Method Syntax (by name)

    Example

    Method Syntax (by ID)

    Example

    Setting the Default Value of a Field

    Using the SetDefaultValue() Method

    Method Syntax

    Example

    Using the SetDefaultValue() Method (Function-Based)

    Method Syntax

    Example

    Making a Field Required

    Using the MakeRequired() Method

    Method Syntax

    Example

    Validating a Field

    Using the SetValidationRegex() Method

    Method Syntax

    Example

    Making a Field Read-only

    Using the MakeReadOnly() Method

    Method Syntax

    Example

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

    Method Syntax

    Example

    Using the MakeReadOnly(object dataTypeNameOrId) Method

    Method Syntax

    Example

    Using the MakeReadOnly(Predicate<>) Method

    Method Syntax

    Example

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

    Method Syntax

    Example

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

    Method Syntax

    Example

    Setting the Visibility of a Field

    Using the SetVisibility() Method for Fields

    Method Syntax

    Example

    SetAlias
    method can be used.

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

    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.

    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.

    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.

    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.

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

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

    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.

    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.

    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.

    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.

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

    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.

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

    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.

    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.

    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.

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

    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.

    Sets the runtime visibility of the collection.

    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.

    Defines the connection string for the collection repository.

    Defining a Collection

    Using the AddCollection() Method

    Method Syntax

    Example

    Using the AddCollection() Method with Icons

    Method Syntax

    Example

    Changing a Collection Alias

    Using the SetAlias() Method

    Tree
    Folder

    Method Syntax

    Example

    Changing a Collection Icon Color

    Using the SetIconColor() Method

    Method Syntax

    Example

    Defining an Entity Name

    Using the SetNameProperty() Method

    Method Syntax

    Example

    Using the SetNameProperty() Method with Custom Heading

    Method Syntax

    Example

    Using the SetNameFormat() Method

    Method Syntax

    Example

    Defining a Default Sort Order

    Using the SetSortProperty() Method

    Method Syntax

    Example

    Using the SetSortProperty() Method with Sort Direction

    Method Syntax

    Example

    Defining Time Stamp Properties

    Using the SetDateCreatedProperty Method

    Method Syntax

    Example

    Using the SetDateModifiedProperty Method

    Method Syntax

    Example

    Configuring Soft Deletes

    Using the SetDeletedProperty() Method

    Method Syntax

    Example

    Disabling Create, Update, or Delete Features

    Using the DisableCreate() Method

    Method Syntax

    Example

    Using the DisableCreate() Method with Conditions

    Method Syntax

    Example

    Using the DisableUpdate() Method

    Method Syntax

    Example

    Using the DisableUpdate() Method with Conditions

    Method Syntax

    Example

    Using the DisableDelete() Method

    Method Syntax

    Example

    Using the DisableDelete() Method with Conditions

    Method Syntax

    Example

    Using the MakeReadOnly() Method

    Method Syntax

    Example

    Using the MakeReadOnly() Method with Conditions

    Method Syntax

    Example

    Setting Collection Visibility

    Using the SetVisibility() Method

    Method Syntax

    Example

    Changing a Collection Connection String

    Using the SetConnectionString() Method

    Method Syntax

    Example

    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    
    [Table("Products")]
    public class Product
    {
        public int Id { get; set; }
    
        [Required]
        [MaxLength(200)]
        public string Name { get; set; } = string.Empty;
    
        [MaxLength(2000)]
        public string? Description { get; set; }
    
        [Column(TypeName = "decimal(18,2)")]
        public decimal Price { get; set; }
    
        public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    
        public DateTime? ModifiedAt { get; set; }
    }
    
    [Table("Categories")]
    public class Category
    {
        public int Id { get; set; }
    
        [Required]
        [MaxLength(100)]
        public string Name { get; set; } = string.Empty;
    
        [MaxLength(500)]
        public string? Description { get; set; }
    }
    
    [Table("ProductCategories")]
    public class ProductCategory
    {
        public int ProductId { get; set; }
    
        public int CategoryId { get; set; }
    }
    
    [Table("ProductReviews")]
    public class ProductReview
    {
        public int Id { get; set; }
    
        [Required]
        public int ProductId { get; set; }
    
        [Required]
        [MaxLength(100)]
        public string ReviewerName { get; set; } = string.Empty;
    
        [Range(1, 5)]
        public int Rating { get; set; }
    
        [MaxLength(1000)]
        public string? Comment { get; set; }
    
        public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    }
    using NPoco;
    using Umbraco.Cms.Infrastructure.Persistence.DatabaseAnnotations;
    
    [TableName("Products")]
    [PrimaryKey("Id")]
    public class Teacher
    {
        [PrimaryKeyColumn]
        public int Id { get; set; }
    
        public string Name { get; set; } = string.Empty;
    
        public string? Description { get; set; }
    
        public decimal Price { get; set; }
    
        public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    
        public DateTime? ModifiedAt { get; set; }
    }
    treeConfig.AddCollection<Product>(x => x.Id, "Product", "Products", "A list of products", "icon-article", "icon-article", collectionConfig =>
    {
        collectionConfig
            .SetAlias("products")
            .SetNameProperty(x => x.Name)
            .ListView(listViewConfig =>
            {
                listViewConfig
                    .AddField(x => x.Name)
                    .AddField(x => x.Description)
                    .AddField(x => x.Price)
            })
            .Editor(editorConfig =>
                editorConfig.AddTab("General", tabConfig =>
                {
                    tabConfig.AddFieldset("Product Details", fieldsetConfig =>
                    {
                        fieldsetConfig
                            .AddField(x => x.Name)
                            .AddField(x => x.Description)
                            .AddField(x => x.Price)
                            .AddField(x => x.IsActive);
                        fieldsetConfig
                              .AddRelatedCollectionPickerField<Category>("productCategories", "Categories Picker", "Categories");
                    });
                })
            );
    });
    ConfigureEFCore(Action<ModelBuilder, CollectionConfig> configure)
    .ConfigureEFCore((modelBuilder, collectionConfig) =>
    {
        modelBuilder.Entity<ProductCategory>(entity =>
        {
            entity.HasKey(t => new { t.ProductId, t.CategoryId });
            entity.ToTable("ProductCategories");
        });
    })
    // Child collection for Product Reviews
    collectionConfig.AddChildCollection<ProductReview>(x => x.Id, x => x.ProductId,
        "Product Review", "Product Reviews", "Reviews for products",
        "icon-article", "icon-article", childCollectionConfig =>
    {
        childCollectionConfig
            .SetNameProperty(x => x.ReviewerName)
            .Editor(editorConfig =>
                editorConfig.AddTab("General", tabConfig =>
                {
                    tabConfig.AddFieldset("Review Details", fieldsetConfig =>
                    {
                        fieldsetConfig
                            .AddField(x => x.ReviewerName)
                            .AddField(x => x.Rating)
                            .AddField(x => x.Comment);
                    });
                })
            );
    });
    
    // Related collection for Categories
    collectionConfig.AddRelatedCollection<Product, Category, ProductCategory>(
        x => x.Id,
        "productReview",
        "productReviews",
        relationConfig =>
            relationConfig
                .SetAlias("productCategories")
                .SetJunction<ProductCategory>(x => x.ProductId, y => y.CategoryId));
    collectionConfig.SetRepositoryType<ProductRepository>();
    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 => {
        ...
    });
    Editor(Lambda editorConfig = null) : EditorConfig<TEntityType>
    collectionConfig.Editor(editorConfig => {
        ...
    });
    AddTab(string name, Lambda tabConfig = null) : EditorTabConfigBuilder<TEntityType>
    editorConfig.AddTab("General", tabConfig => {
        ...
    });
    Sidebar(Lambda sidebarConfig = null) : EditorTabSidebarConfigBuilder<TEntityType>
    tabConfig.Sidebar(sidebarConfig => {
        ...
    });
    SetVisibility(Predicate<EditorTabVisibilityContext> visibilityExpression) : EditorTabConfigBuilder<TEntityType>
    tabConfig.SetVisibility(ctx => ctx.EditorMode == EditorMode.Create);
    AddFieldset(string name, Lambda fieldsetConfig = null) : EditorFieldsetConfigBuilder<TEntityType>
    tabConfig.AddFieldset("Contact", fieldsetConfig => {
        ...
    });
    SetVisibility(Predicate<EditorFieldsetVisibilityContext> visibilityExpression) : EditorFieldsetConfigBuilder<TEntityType>
    fieldsetConfig.SetVisibility(ctx => ctx.EditorMode == EditorMode.Create);
    AddField(Lambda propertyExpression, Lambda propertyConfig = null) : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldsetConfig.AddField(p => p.FirstName, fieldConfig => {
        ...
    });
    SetLabel(string label) : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.SetLabel("First Name");
    HideLabel() : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.HideLabel();
    SetDescription(string description) : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.SetDescription("Enter your age in years");
    SetDataType(string dataTypeName) : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.SetDataType("Richtext Editor");
    SetDataType(int dataTypeId) : EditorFieldConfigBuilder<TEntityType, TValueType>
    
    fieldConfig.SetDataType(-88);
    SetDefaultValue(TValueType defaultValue) : EditorFieldConfigBuilder<TEntityType, TValueType>
    // Example
    fieldConfig.SetDefaultValue(10);
    SetDefaultValue(Func defaultValueFunc) : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.SetDefaultValue(() => DateTime.Now);
    MakeRequired() : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.MakeRequired();
    SetValidationRegex(string regex) : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.SetValidationRegex("[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}");
    MakeReadOnly() : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.MakeReadOnly();
    MakeReadOnly(Func<TValueType, string> format) : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.MakeReadOnly(distanceProp => $"{distanceProp:## 'km'}");
    MakeReadOnly(object dataTypeNameOrId) : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.MakeReadOnly("myReadOnlyEditor");
    MakeReadOnly(Predicate<EditorFieldReadOnlyContext> readOnlyExp) : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.MakeReadOnly(ctx => ctx.EditorMode == EditorMode.Create);
    MakeReadOnly(Predicate<EditorFieldReadOnlyContext> readOnlyExp, Func<TValueType, string> format) : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.MakeReadOnly(ctx => ctx.EditorMode == EditorMode.Create, distanceProp => $"{distanceProp:## 'km'}");
    MakeReadOnly(Predicate<EditorFieldReadOnlyContext> readOnlyExp, object dataTypeNameOrId) : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.MakeReadOnly(ctx => ctx.EditorMode == EditorMode.Create, "myReadOnlyEditor");
    SetVisibility(Predicate<EditorFieldVisibilityContext> visibilityExpression) : EditorFieldConfigBuilder<TEntityType, TValueType>
    fieldConfig.SetVisibility(ctx => ctx.EditorMode == EditorMode.Create);
    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 => {
        ...
    });
    SetAlias(string alias) : CollectionConfigBuilder<TEntityType>
    collectionConfig.SetAlias("person");
    SetIconColor(string color) : CollectionConfigBuilder<TEntityType>
    collectionConfig.SetIconColor("blue");
    SetNameProperty(Lambda namePropertyExpression) : CollectionConfigBuilder<TEntityType>
    collectionConfig.SetNameProperty(p => p.Name);
    SetNameProperty(Lambda namePropertyExpression, string heading) : CollectionConfigBuilder<TEntityType>
    collectionConfig.SetNameProperty(p => p.Name, "Person Name");
    SetNameFormat(Lambda nameFormatExpression) : CollectionConfigBuilder<TEntityType>
    collectionConfig.SetNameFormat(p => $"{p.FirstName} {p.LastName}");
    SetSortProperty(Lambda sortPropertyExpression) : CollectionConfigBuilder<TEntityType>
    collectionConfig.SetSortProperty(p => p.FirstName);
    SetSortProperty(Lambda sortPropertyExpression, SortDirection sortDirection) : CollectionConfigBuilder<TEntityType>
    collectionConfig.SetSortProperty(p => p.FirstName, SortDirection.Descending);
    SetDateCreatedProperty(Lambda dateCreatedProperty) : CollectionConfigBuilder<TEntityType>
    collectionConfig.SetDateCreatedProperty(p => p.DateCreated);
    SetDateModifiedProperty(Lambda dateCreatedProperty) : CollectionConfigBuilder<TEntityType>
    collectionConfig.SetDateModifiedProperty(p => p.DateModified);
    SetDeletedProperty(Lambda deletedPropertyExpression) : CollectionConfigBuilder<TEntityType>
    collectionConfig.SetDeletedProperty(p => p.Deleted);
    DisableCreate() : CollectionConfigBuilder<TEntityType>
    collectionConfig.DisableCreate();
    DisableCreate(Predicate<CollectionPermissionContext> disableExpression) : CollectionConfigBuilder<TEntityType>
    collectionConfig.DisableCreate(ctx => ctx.UserGroups.Any(x => x.Alias == "editor"));
    DisableUpdate() : CollectionConfigBuilder<TEntityType>
    collectionConfig.DisableUpdate();
    DisableUpdate(Predicate<CollectionPermissionContext> disableExpression) : CollectionConfigBuilder<TEntityType>
    collectionConfig.DisableUpdate(ctx => ctx.UserGroups.Any(x => x.Alias == "editor"));
    DisableDelete() : CollectionConfigBuilder<TEntityType>
    collectionConfig.DisableDelete();
    DisableDelete(Predicate<CollectionPermissionContext> disableExpression) : CollectionConfigBuilder<TEntityType>
    collectionConfig.DisableDelete(ctx => ctx.UserGroups.Any(x => x.Alias == "editor"));
    MakeReadOnly() : CollectionConfigBuilder<TEntityType>
    collectionConfig.MakeReadOnly();
    MakeReadOnly(Predicate<CollectionPermissionContext> disableExpression) : CollectionConfigBuilder<TEntityType>
    collectionConfig.MakeReadOnly(ctx => ctx.UserGroups.Any(x => x.Alias == "editor"));
    SetVisibility(Predicate<CollectionVisibilityContext> visibilityExpression) : CollectionConfigBuilder<TEntityType>
    collectionConfig.SetVisibility(ctx => ctx.UserRoles.Any(x => x.Alias == "editor"));
    SetConnectionString(string connectionStringName) : CollectionConfigBuilder<TEntityType>
    collectionConfig.SetConnectionString("myConnectionStringName");