A list of known limitations and issues in Umbraco UI Builder
Umbraco UI Builder strives to closely mimic the content pipeline while adhering to public and supported APIs. This ensures full compatibility with the Data Type suite for property editing. However, some features in the Umbraco Core rely on internal methods, making full support for certain functionalities challenging. Below is a list of known issues.
Property Editors
Tags
While Umbraco UI Builder supports persisting tag values, it currently does not write these tags to the cmsTags database table. This functionality is managed by the internal tagsRepository, which is not publicly accessible, preventing direct saving in the same manner as Umbraco Core.
Block Editors
Block Editors (Block List/Block Grid) are not currently supported due to casting errors between the JSON string representation and collection property.
An implementation to address this is investigated and will be scheduled for a future major release.
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.
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.
Umbraco 10 and above Documentation
Using The Documentation
This documentation is intended for developers with a basic understanding of Umbraco and C#/MVC principles.
If you are new to Umbraco UI Builder, it is recommended to start with the Getting Started section. This section covers system requirements and installation instructions.
Once you have Umbraco UI Builder installed, explore the Guides section. This section provides a quick-start example on configuring Umbraco UI Builder.
Use the main menu to explore features in detail and navigate directly to topics of interest.
For additional resources and best practices, visit the Miscellaneous section.
Getting Help
If you need assistance, refer to our support channels for help and troubleshooting.
Example Umbraco UI Builder UI
Overview
Learn how to choose and configure the appropriate area for connecting Umbraco UI builder for Umbraco.
Umbraco UI Builder can be integrated into different areas of the Umbraco Backoffice. Before you start managing content, it is essential to decide which area best suits the presentation of your data. Each area offers unique features for displaying and interacting with content.
Once you have identified the most appropriate area, you can proceed with configuring it to suit your needs.
Key Areas for Integration
: The Sections area allows you to organize your content in a structured layout, enabling users to navigate different parts of the backoffice.
: The Dashboards area is ideal for creating custom views that provide quick access to key information and statistics.
: Context Apps provide contextual tools and information based on the specific content a user is working with.
Selecting the correct area is essential to ensure your UI is both functional and user-friendly. Consider the nature of your content and the tasks users need to perform when deciding which area to use.
Version Specific Upgrade Notes
Version specific documentation for upgrading to major versions of Umbraco UI Builder.
This article provides upgrade instructions for major versions of Umbraco UI Builder.
For minor or patch upgrades, check the Release Notes for breaking changes.
Legacy Version Upgrade Notes
For out-of-support versions, see the .
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:
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.
Get started by reviewing how to define searchable properties.
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.
Displaying a Collection on the Summary Dashboard
Conventions
Guidelines for fluent configuration and naming conventions in Umbraco UI Builder.
Fluent Conventions
Umbraco UI Builder follows a fluent configuration style, allowing method chaining for concise and readable code. Alternatively, a lambda expression can be used for a more structured approach.
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.
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.
Follow the steps to install Umbraco UI Builder into your Umbraco CMS website.
In this article, you will learn how to install Umbraco UI Builder into your Umbraco CMS implementation.
Install via Command Line
Run the following command in your web project:
For a class library without UI elements, install:
Install via Visual Studio
To install via Visual Studio, follow these steps:
Open Visual Studio and load your project.
Go to Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution...
Select the Browse tab and search for Umbraco.UIBuilder.
Select a version from the Version drop-down based on the Umbraco CMS version you are using.
Click Install.
[Optional] Search for and install Umbraco.UIBuilder.Startup if installing without UI elements.
Installing a License
For details on how to install a license, see the article.
Configuration
Learn how to configure Umbraco UI Builder in your project using two different approaches.
You can configure Umbraco UI Builder either via a Composer or in the Program.cs.
Option 1: Configuring via a Composer
A Composer is a common approach for registering and configuring services in Umbraco during application startup.
To configure Umbraco UI Builder via a Composer:
Create a file called UIBuilderComposer.cs in your project.
Implement the IComposer interface and add the configuration inside the Compose method:
Option 2: Configuring via Program.cs
You can also configure Umbraco UI Builder directly in Program.cs using the AddUIBuilder extension method.
To configure Umbraco UI Builder:
Open the Program.cs file in your project.
Locate the CreateUmbracoBuilder() method.
Add AddUIBuilder before AddComposers()
Example Configuration
For a complete sample configuration, see the article.
The AddUIBuilder method accepts a delegate function, allowing you to configure your solution using fluent APIs.
Release Notes
Get an overview of the things changed and fixed in each version of Umbraco UI Builder.
This section summarizes the changes and fixes introduced in each version of Umbraco UI Builder. Each release includes a link to the UI Builder issue tracker, where you can find a list of resolved issues. Individual issues are also linked for more details.
If there are any breaking changes or other issues to be aware of when upgrading they are also noted here.
Below are the release notes for Umbraco UI Builder, detailing all changes in this version.
(December 18th 2025)
Updated the cards UI adopting a slimmer appearance
Fixed card counter caused by a regression in 17.0.0
Fixed a top padding issue with child collections
(December 12th 2025)
Fixed a regression impacting child collections
(December 11th 2025)
Added additional localization support for editor fields labels and descriptions, collection filters, cards, data views
Fixed entity menu actions display
Enable columns sorting for collections list view
17.0.0 (November 27th 2025)
Final release to support Umbraco 17
17.0.0-rc2 (November 25th 2025)
Compatibility update for Umbraco 17.0.0-rc4 and Swashbuckle 10
17.0.0-rc1 (November 3rd 2025)
Compatibility update for Umbraco 17.0.0-rc1
Legacy Release Notes
You can find the release notes for Konstrukt in the .
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:
Configuration Options
Option
Description
Required
Adding a Custom Card to a Collection
Using the AddCard() Method
Adds a custom card of the specified type to the collection.
Method Syntax
Example
Using the AddCard(Type cardType) Method
Adds a custom card of the specified type to the collection, using the Type parameter to pass the card type dynamically.
Method Syntax
Example
Field Views
Configuring Field Views in Umbraco UI Builder.
Field Views allow customization of the markup used by a field when displayed in a list view. Field Views are implemented as .NET Core View Components, which are passed a FieldViewsContext argument containing information about the entity/field being rendered.
Defining a Field View
You can define a field view in one of two ways:
Basic View File for the Built-In FieldView View Component
For field views, place a view file in the /Views/Shared/Components/FieldView folder with the following markup.
To register the view, pass the name of the view file (excluding the .cshtml file extension) to the relevant API method.
Custom View Component
For more complex field views, create a custom view component class that can use dependency injection for any required dependencies. Use the following signature:
{% 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:
The Field View Context
Field view components are passed a FieldViewContext object with the following properties:
Setting the Field View of a List View Field
A field view is assigned to a list view field as part of the list view configuration. For more information, see the article.
Count Cards
Learn how to configure count cards in Umbraco UI Builder.
Count cards allow you to define cards directly against the Collection configuration, providing a basic where clause to use in a count SQL statement. These work perfectly for basic data visualizations based on counts of entities in a collection.
If you need to do more than a basic count, see the Custom Cards article.
Adding a Count Card to a Collection
Count cards display basic summaries of key information that may be useful to the editor.
Using the AddCard() Method
Adds a count card with the specified name and a where clause filter expression. The filter expression must be a boolean value.
Method Syntax
Example
Using the AddCard() Method with Icon
Adds a count card with the specified name, an icon, and a where clause filter expression. The filter expression must be a boolean value.
Method Syntax
Example
Change the Color of a Count Card
Using the SetColor() Method
Sets the color for the count card.
Method Syntax
Example
Add a Suffix to a Count Value
Using the SetSuffix() Method
Sets a suffix to be displayed alongside the card value.d
Method Syntax
Example
Formatting the Value of a Count
Using the SetFormat() Method
Sets a custom format for the card's value.
Method Syntax
Example
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
Example
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.
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:
Data Views Builders
Learn how to configure data views builders in Umbraco UI Builder.
Data views builders allow you to create a collection’s data views dynamically at runtime. By default, Umbraco UI Builder uses hard-coded data views from the configuration. However, if you need to generate data views dynamically, a data views builder is required.
When resolving a data views builder, Umbraco UI Builder first attempts to retrieve it from the global Dependency Injection (DI) container. This allows injecting required dependencies into the builder. If no type is defined in the DI container, Umbraco UI Builder falls back to manually instantiating a new instance of the value mapper.
Defining a Data Views Builder
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 for potential breaking changes and common pitfalls.
Before upgrading, take a complete backup of your site and database.
Licensing
Learn about licensing, including coverage, installation, and validation options.
Umbraco UI Builder is a commercial product. You can use Umbraco UI Builder locally without a license. When running Umbraco UI Builder on a public domain the usage is limited to a single editable collection. To remove these restrictions, a valid license is required.
How Licensing Works
Licenses are sold per backoffice domain and applies to all subdomains. If you have alternative staging/QA environment domains, additional domains can be added to the license on request.
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
Overview
Learn how to configure filtering in Umbraco UI Builder.
In addition to , you may need to create specific views of a collection's data. Umbraco UI Builder provides multiple filtering mechanisms to help with this.
Choose a filtering method from the list below to find out more.
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.
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.
Get started by reviewing the basics of collection configuration.
dotnet add package Umbraco.UIBuilder
dotnet add package Umbraco.UIBuilder.Startup
The licenses are not tied to a specific product version. They work across all versions of the related product.
Example License Coverage
A license for mysite.com and requested dev domains (devdomain.com and devdomain2.com) will cover:
localhost
*.local
*.mysite.com
www.mysite.com
devdomain.com
www.devdomain.com
devdomain2.com
www.devdomain2.com
Only one license per Umbraco installation is allowed.
What a License Covers?
There are a few differences as to what the licenses cover:
A single license covers the installation of Umbraco UI Builder in one production backoffice domain, as well as in any requested development domains.
The production domain includes all subdomains (e.g. *.mysite.com).
The development domains work with or without the www subdomain.
The license allows for an unlimited number of editable collections.
The license also includes localhost and *.local as a valid domain.
If you have multiple backoffice domains pointing at the same installation, you can purchase and 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
You can look at the pricing, features, and purchase a license on the Umbraco UI Builder page. On this page, you can fill out the form with your project details and requirements.
A member of the Sales team will manage this process. In the process, you will need to provide all domains you wish to have covered by the license such as primary and staging/QA domains. You should then receive a license code to be installed in your solution.
Adding Additional Domains
If you require to add additional domains to the license, reach out to the sales team. They will manage your request and take care of the process.
Configuring your license
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 Configure Licenses article.
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();
// 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
}
}
@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; }
}
// 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
}
}
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
...
}
}
Go to the Settings section in the Umbraco backoffice.
Create a New Data Type.
Select UI Builder Entity Picker from the Property Editor field.
Data Type config
Enter a Name for the picker and click Save.
Select the Section the collection is located in.
Select the Collection to pick the entities from.
[Optional] Select a list view Data View, if configured.
Enter a Minimum number of items and Maximum number of items that can be selected.
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:
Go to the Document Type where the entity picker Data Type is added.
Click Add to open the picker dialog, displaying a paginated list of entities.
[Optional] If searchable fields are configured, use the search input field to filter results.
Entity picker dialog
Click on the entity names.
Click Submit. The picker displays a summary of selected entities, which can be reordered by dragging them.
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.
Creating your First Integration
Creating your first integration with Umbraco UI Builder.
This guide walks you through a basic implementation of Umbraco UI Builder to manage a custom database table.
By default, Umbraco UI Builder uses a database for data storage. However, you can configure this using a custom Repository class instead.
Setting Up the Database
Umbraco UI Builder uses PetaPoco as its default persistence layer.
In this section, you will create a Person table to store data.
To create a Person table, run the following script in SQL Server Management Studio (SSMS).
This script creates a table for storing people’s details. You may want to populate it with some dummy data for testing.
Setting Up the Model
With the database table created, define the Person model in your project.
To create a Model:
Create a new folder called Models in your project.
Add a new class file called Person.cs.
Add the following code:
Configure Umbraco UI Builder
With the database and model set up, it is time to configure Umbraco UI Builder to work with the Person model. This will allow you to manage Person entities from the Umbraco backoffice.
You can configure Umbraco UI Builder either through a Composer or by using the AddUIBuilder extension method in Program.cs.
The following steps cover the Program.cs approach. For more details, including configuring via a Composer, see the article.
Configuring via Program.cs
Open the Program.cs file in your project.
Locate the CreateUmbracoBuilder() method.
Add AddUIBuilder before AddComposers()
Example Configuration
Here’s an example configuration defining a section, a list view, and an editor for managing Person entities:
Accessing the Umbraco Backoffice
After defining the configuration, compile and run your project. To access the newly defined section, you need to give permission to the backoffice user account:
Login to the Umbraco backoffice.
Go to the Users section.
Navigate to the user group you wish to assign the newly defined section.
Submit the changes.
Refresh the browser to view the new section.
If you click on a person's name, you will see the following screen:
Summary
This setup allows you to extend and customize your Umbraco site by managing data and entities directly in the backoffice. The simplicity of the implementation allows to create dynamic, user-friendly interfaces for your own data models.
List Views
Configuring the list view of a collection in Umbraco UI Builder.
A list view displays a collection entity in a list format and includes features like pagination, custom data views, searching, and bulk actions.
A collection list view
Configuring a List View
The list view configuration is a sub-configuration of a Collection config builder instance and can be accessed via the ListView method.
Using the ListView() Method
Accesses the list view configuration for the specified collection.
Method Syntax
Example
Adding a Field to the List View
Using the AddField() Method
Adds a specified property to the list view.
Method Syntax
Example
Changing the Heading of a Field
Using the SetHeading() Method
Sets the heading for a field in the list view.
Method Syntax
Example
Formatting the Value of a Field
Using the SetFormat() Method
Sets the format expression to the field in the list view.
Method Syntax
Example
Setting the View of a Field
You can customize the field's markup with field views, allowing richer visualizations of the content. For more details, see the article.
Using the SetView() Method
Sets the view component for the list view field.
Method Syntax
Example
Using the SetView<TView>() Method
Sets the view component for the list view field.
Method Syntax
Example
Setting the Visibility of a Field
Using the SetVisibility() Method
Controls the runtime visibility of a field in the list view.
Method Syntax
Example
Changing the Page Size
Using the SetPageSize Method
Sets the number of items per page for the list view.
Method Syntax
Example
Migrate from Konstrukt to Umbraco UI Builder
Step-by-step guide to migrating a Konstrukt solution to Umbraco UI Builder.
This guide walks you through migrating a default Konstrukt solution to Umbraco UI Builder.
Key Changes
Before starting, review these key changes that impact the migration process.
Project, Package, and Namespace changes
Konstrukt
Umbraco UI Builder
Code and UI Changes
C# Class Changes
Namespace changes as mentioned above.
Most Konstrukt-prefixed classes have had the prefix removed.
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
Step 1: Replace Dependencies
Replace all existing Konstrukt dependencies with Umbraco UI Builder dependencies.
Remove existing Konstrukt packages:
Delete the Konstrukt App_Plugins folder:
Install Umbraco.UIBuilder:
Compile your project against .NET 7.0.
Step 2: Update Namespaces and Entity Names
Update all Konstrukt references to their Umbraco UI Builder alternatives. Ensure you update any Views/Partials that also reference these. See the section for reference.
Step 3: Update Configuration
If your configuration is in a single statement, replace AddKonstrukt with AddUIBuilder.
For multi-step configurations using Action or Card classes, update the config builders and base classes to their UI Builder alternatives as described in .
Step 4: Finalize the Migration
Delete obj/bin folders for a clean build.
Recompile all projects and ensure all dependencies are restored correctly.
Remove existing Konstrukt license files from umbraco\Licenses folder.
Run the project.
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.
In the above example, the Student model represents the parent entity. A student can have multiple associated StudentProjects.
The StudentProjects model represents the child entity. The StudentId is a foreign key that links each StudentProject to the Student entity, establishing the one-to-many relationship.
Child Repositories
To retrieve data from child collections, you can use the IRepositoryFactory to create child repository instances. These repositories provide methods to fetch child entities associated with a given parent entity.
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.
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.
Dashboard
Each section in the Umbraco backoffice typically starts with a dashboard. This is an introductory screen for the section. It often includes useful links or shortcuts, providing an overview or quick access to the most commonly used features.
Collection
The collection displays a list of items in a tree or grid view. It provides an overview of content or data in a table format, with sortable columns and the option to filter or search through the items. This view is used when you need to work with multiple items at once.
Editor
The editor is where the main content editing occurs. It is structured using tabs, fieldsets, and fields. Tabs organize different sections of content, and fieldsets group related fields together. Each field represents a specific piece of data, such as a text box or an image upload.
Workspace Views
Workspace Views are additional functionality that can be added to an editor. They provide extra features based on the content of the item being edited. For instance, a media Workspace View might allow you to resize or crop an image directly from the editor.
Tabs
Tabs are used to organize content within the editor, allowing users to switch between different sections of a content item. For example, one tab might contain the general settings, while another contains media or advanced options.
Menu Item
A menu item represents an action within the context of a tree node or a list item. It is a clickable item that triggers specific tasks, such as deleting or editing an item.
Bulk Action
Bulk actions allow you to perform an operation on multiple items in the list view at once. For example, you might use a bulk action to delete multiple content items or update their status in a single step.
Entity 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 UDI Identifiers section of the documentation.
If you want to reference an Umbraco object in your model and retrieve its Integer or Guid value, you must convert the UDI value.
Use one of UI Builder's converters - EntityIdentifierToIntTypeConverter or EntityIdentifierToGuidTypeConverter. Add it as a [TypeConverterAttribute] to your model's foreign key property.
An entity that references an Umbraco object would look like this:
You can also create a custom type converter. UI Builder will handle data persistence automatically.
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
Searchable Properties
Configure searchable properties in Umbraco UI Builder.
Searchable properties allow you to define any String based properties in a model. It can be searched via Umbraco UI Builder's list view and entity picker search controls.
Both direct String properties and String properties within nested objects can be made searchable, provided the parent object is not null.
Search
Defining Searchable Properties
Using AddSearchableProperty() Method
Use AddSearchableProperty to specify which properties should be included in search functionality.
Method Syntax
Example
Search Expression Pattern
The search behavior differs based on the version:
Up to version 15.0.1: Search uses the StartsWith method, meaning results include entries that begin with the search term.
Version 15.0.1 and later: Search can be configured to use Contains, allowing results that include the search term anywhere within the property value.
Example
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
Example
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
Example
Using the AddAllDataView Method
Enables the All option for data views in the collection. The method can take an empty string, which will display the CMS localized All value, plain text, or a localized string.
Method Syntax
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:
Configuring and customizing sections in Umbraco UI Builder to organize and manage the backoffice interface effectively.
A section in Umbraco represents a distinct area within the backoffice, such as content, media, and so on. Sections are accessible via links in the main menu at the top of the Umbraco interface. Using Umbraco UI Builder, multiple sections can be defined to organize the management of models logically.
Defining a Section
Sections are defined using the AddSection method on the root-level UIBuilderConfigBuilder
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.
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 API, offering flexibility for managing and displaying related data within your backoffice UI.
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 . 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
// Example
foreach(var p in Model.People){
...
}
[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; }
}
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.
[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; }
}
This method adds a new section to the Umbraco menu with the specified name, allowing custom areas for organizing content in the backoffice.
Method Syntax
Example
Using the AddSectionBefore() Method
This method adds a section before another section with the specified alias, allowing for customized ordering of sections in the backoffice.
Method Syntax
Example
Using the AddSectionAfter() Method
This method adds a section after another section with the specified alias, allowing for a custom order of sections in the backoffice.
Method Syntax
Example
Customizing the Section Alias
Setting a Custom Alias with SetAlias() Method
This method sets a custom alias for the section.
Optional: By default, an alias is automatically generated from the section's name. To customize the alias, the SetAlias() method can be used.
Method Syntax
Example
Configuring the Section Tree
Using the Tree() Method for Configuration
This method configures the tree structure for the section, which is used to organize content types. For more information, see the Trees article.
Method Syntax
Example
Adding Dashboards to the Section
Adding a Dashboard with the AddDashboard() Method
This method adds a dashboard to the section with the specified alias, providing tools and features for content management. For more information, see the Dashboards article.
Method Syntax
Example
Using AddDashboardBefore() to Place a Dashboard
This method adds a dashboard before another dashboard with the specified alias, allowing custom placement in the section. For more information, see the Dashboards article.
Method Syntax
Example
Using AddDashboardAfter() to Place a Dashboard
This method adds a dashboard after another dashboard with the specified alias, giving control over dashboard order. For more information, see the Dashboards article.
Method Syntax
Example
Extending Existing Sections
You can extend existing sections by adding Umbraco UI Builder trees and dashboards, context apps, and virtual subtrees. This can be done by calling the WithSection method on the root-level UIBuilderConfigBuilder instance.
Extending an Existing Section with WithSection()
This method extends an existing section with additional configuration, enabling more customization for existing areas.
Method Syntax
Example
Adding Trees to an Existing Section
Using the AddTree() Method
This method adds a tree to the section, helping to visualize and organize content types. For more information, see the Trees article.
Method Syntax
Example
Grouping Trees with AddTree() Method
This method adds a tree within a specified group, improving content organization by grouping related trees together. For more information, see the Trees article.
Method Syntax
Example
Adding a Tree Before or After an Existing Tree
Using AddTreeBefore() to Position a Tree
This method adds a tree before another tree within the section, allowing you to customize the tree order. For more information, see the Trees article.
Method Syntax
Example
Using AddTreeAfter() to Position a Tree
This method adds a tree after another tree within the section, enabling specific ordering of trees. For more information, see the Trees article.
Method Syntax
Example
Adding a Dashboard to an Existing Section
Using the AddDashboard() Method
This method adds a new dashboard to the section with the specified name. For more information, see the Dashboards article.
Method Syntax
Example
Using the AddDashboardBefore() Method
This method adds a dashboard before the dashboard with the specified alias. For more information, see the Dashboards article.
Method Syntax
Example
Using the AddDashboardAfter() Method
This method adds a dashboard after the dashboard with the specified alias. For more information, see the Dashboards article.
Method Syntax
Example
Sections
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
Example
Using the AddChildCollection() Method with Custom Icons
This method adds a child collection to the current collection with the specified names, description and custom icons. Both the entity ID and foreign key fields must be specified using property accessor expressions.
Method Syntax
Example
Configuring a Child Collection
Child collections share the same API as the Collection config builder API, except child collections cannot contain further child collections. For more information, see the Basics article.
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
);
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();
[TableName("StudentProjects")]
[PrimaryKey("Id")]
public class StudentProject
{
[PrimaryKeyColumn]
public int Id { get; set; }
public string Name { get; set; }
public int StudentId { get; set; }
}
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);
}
}
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.
collectionConfig.AddChildCollection<Child>(c => c.Id, c => c.ParentId, "Child", "Children", "A collection of children", "icon-umb-users", "icon-umb-users", childCollectionConfig => {
...
});
The IsVisible method receives an ActionVisibilityContext. You can use this context to decide whether the action should be displayed. Return true to show it, or false to hide it. For more information, see the Action visibility context section below.
Overriding Action Visibility
You can override an action's visibility in the Collections settings.
Using the AddAction<TMenuActionType>() Method
Adds an action of the given type to the collection with the specified visibility.
Method Syntax
Example
Using the AddAction(Type actionType, Lambda actionConfig = null) Method
Adds an action of the given type to the collection by specifying the action type dynamically using Type instead of a generic type.
Method Syntax
Example
Using the AddAction(IAction action, Lambda actionConfig = null) Method
Adds the already defined action instance to the collection with the specified visibility.
Method Syntax
Example
Action Visibility Context
When controlling the visibility of an action, you will receive an ActionVisibilityContext object. This context allows you to decide whether to show the action. The context contains two key pieces of information for this decision.
ActionType
The ActionType property is an enum property that defines which area of the UI wants to access the action. This property helps determine where the action is displayed.
ContainerMenu
The ContainerMenu action type displays the action in both the collection tree and its list view actions menu.
Container Menu
EntityMenu
The EntityMenu action type shows the action in the collection editor UI's actions menu.
Entity Menu
Bulk
The Bulk action type displays the action in the collection list view bulk actions menu.
Bulk Actions
Row
The Row action type shows the action in the collection list view action row menu.
Row Actions
Save
The Save action type displays the action as a sub-button in the entity editor’s save button. All Save actions trigger a save before executing. Their labels are prefixed with Save & [Action Name].
Save Actions
UserGroups
The UserGroups collection contains a list of IReadOnlyUserGroup objects for the current logged-in backoffice user. This allows you to control action visibility for members of specific user groups.
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.
Collections Representation
This is how the collections would be represented:
The models representing the entities would be as follows:
Defining a Related Collection
To define a related collection, follow these two steps:
Add the collection definition
Add the related collection entity picker and definition
Collection definition
Define a related collection by calling the AddRelatedCollection method on the collection config builder instance.
Using the AddRelatedCollection() Method
This method adds a related collection to the current collection, specifying names, descriptions, and default icons. The ID property must be defined, and the relation configuration defines the junction entity with references to parent and child entities.
Method Syntax
Example
Configuring a Related Collection Entity Picker
Define the child collection entity picker by calling the AddRelatedCollectionPickerField method on the parent collection's fieldset config.
Using the AddRelatedCollectionPickerField() Method
This method adds an entity picker with the specified Data Type name to the parent collection editor.
Method Syntax
Example
The relation config alias must match the related collection picker field alias, for example, studentsCourses.
Defining Repository Methods
Using the GetRelationsByParentIdImpl<>() Method
Retrieves related collections based on the ID of the parent entity.
Method Syntax
Example
Using the SaveRelationImpl<>() Method
Adds a new related collection to the current parent entity.
Method Syntax
Example
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
Example
Using the AddVirtualSubTreeBefore() Method
Adds a virtual subtree to the current tree before the tree node matches the match expression, with its visibility controlled by the specified expression.
Method Syntax
Example
Using the AddVirtualSubTreeAfter() Method
Adds a virtual subtree to the current tree after the tree node matches the match expression, with its visibility controlled by the specified expression.
Method Syntax
Example
Control the Virtual SubTrees Inject Location
Control the injection location by passing a visibility expression to the AddVirtualSubTree methods on the root UIBuilderConfigBuilder instance. Without a visibility expression, the subtree appears under every node in the target tree. This expression can be used to identify the exact location where the tree should go.
The visibility expression receives a VirtualSubTreeFilterContext argument with relevant contextual information. The information includes the current node being rendered, alongside a list of the current user's user groups for permission-based visibility control. It also includes access to an IServiceProvider for dependency resolution.
Example: Filter Injection by Document Type
Control the Position of the injected Virtual SubTrees
The position of a virtual subtree within the child nodes of the injection node is controlled by using one of the AddVirtualSubTreeBefore or AddVirtualSubTreeAfter methods. These methods need to be on the root level UIBuilderConfigBuilder instance. The match expression identifies the node for insertion. This expression passes a single TreeNode argument to determine the position. It also requires a boolean return value to indicate the relevant location has been found.
Below you can find an example of positioning a subtree after a node with the alias "settings":
Configuring a Virtual SubTree
Virtual subtrees use the Tree config builder API including support for folders and collections. There is an exception when adding collections to a subtree where you will have an additional foreign key expression parameter to define. The foreign key expression links the entities of the collection to the parent node of the subtree. For more information, see the article.
Inject Virtual Subtrees into Third-Party Trees
Out of the box, Umbraco UI Builder supports injecting subtrees into the core content, media, members, and member group trees. It also includes third-party support for settings and commerce trees. To inject into additional trees, implement an ITreeHelper to extract necessary data. The tree helper consists of a tree alias for which the tree helper is. It includes methods to correctly identify the full parent path, a unique ID for a given node ID, and to resolve the actual entity ID. The entity ID should be used for the foreign key collection values.
Once you have defined a tree helper, register the DI container in your startup class.
Once registered, any virtual subtree assigned to the helper’s tree alias will use it to locate required data.
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
Example
Using the AddFolder() Method with Custom Icon
Adds a folder to the current tree with a specified name and icon.
Method Syntax
Example
Changing a Folder Alias
When creating a new folder, an alias is automatically generated. However, if you need a specific alias, you can use the SetAlias method to override it.
Using the SetAlias() Method
Sets a custom alias for a folder.
Method Syntax
Example
Changing a Folder Icon Color
Using the SetIconColor() Method
Sets the folder icon color to the given color. The available colors are: black, green, yellow, orange, blue, or red.
Method Syntax
Example
Adding a Sub-Folder To a Folder
Using the AddFolder() Method for Sub-Folders
Adds a sub-folder inside the current folder with a specified name and a default folder icon.
Method Syntax
Example
Using the AddFolder() Method for Sub-Folders with Custom Icon
Adds a sub folder to the current folder with a specified name and custom icon.
Method Syntax
Example
Adding a Collection to a Folder
Using the AddCollection<>() Method
Adds a collection to the current folder with the given names, descriptions, and default icons. The ID property must be defined. For more details, see the article.
Method Syntax
Example
Using the AddCollection<>() Method with Custom Icons
Adds a collection to the current folder with the given names, description and icons. The ID property must be defined. For more details, see the article.
Method Syntax
Example
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 or a instance.
Using the AddDashboard() Method
Adds a dashboard with the specified name.
Method Syntax
Example
Using the AddDashboardBefore() Method
Adds a dashboard with the specified name before the dashboard with the given alias.
Method Syntax
Example
Using the AddDashboardAfter() Method
Adds a dashboard with the specified name after the dashboard with the given alias.
Method Syntax
Example
Setting a Custom Dashboard Alias
Using the SetAlias() Method
Sets the alias of the dashboard. By default, an alias is automatically generated based on the supplied name. If a specific alias is required, the SetAlias method can be used to override the default.
Method Syntax
Example
Controlling Dashboard Visibility
Dashboard visibility can be controlled using ShowForUserGroup and HideForUserGroup, which specify which user groups can see the dashboard. These settings can be applied multiple times for different user roles.
By default, dashboards are pre-filtered to display only in their defined section. This filtering is combined with the SetVisibility method to control when a dashboard appears.
Using the SetVisibility() Method
Defines visibility rules for the dashboard.
Method Syntax
Example
Assigning a Collection to a Dashboard
A dashboard can display only one collection. To display multiple collections, multiple dashboards must be configured.
Using the SetCollection<>() Method
Assigns a collection to the dashboard with the specified names, descriptions, and default icons. The ID property must be defined. For more details, see the article.
Method Syntax
Example
Using the SetCollection<>() Method with Custom Icons
Assigns a collection to the dashboard with the specified names, descriptions, and custom icons. The ID property must be defined. For more details, see the article.
Method Syntax
Example
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
Localization Services
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.
Example
Localizing a Collection
For a Students collection, use the following fluent configuration:
Alternatively, you can use the lowercase version:
Define the translation in your localization dictionary file:
Localizing a Section
For a custom section, use the following configuration:
Localizing an additional area
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:
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
Example
Changing the Label of a Filterable Property
Using the SetLabel() Method
Sets the label for the filterable property.
Method Syntax
Example
Adding a Description to a Filterable Property
Using the SetDescription() Method
Sets a description for the filterable property.
Method Syntax
Example
Defining Basic Options for a Filterable Property
Using the SetOptions() Method
Defines basic options for a filterable property.
Method Syntax
Example
Defining Options with Custom Compare Clauses for a Filterable Property
Using the AddOption() Method
Defines options with custom comparison clauses for a filterable property.
Method Syntax
Example
Configuring the Mode of a Filterable Property
For filterable properties with options, you can configure whether the options should allow multiple or single selections.
Using the SetMode() Method
Configures the mode of a filterable property (multiple or single choice).
Method Syntax
Example
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.
{% hint style="info" %} Impl
// Example
public class MyAction : Action<ActionResult>
{
...
public override bool IsVisible(ActionVisibilityContext ctx)
{
return ctx.ActionType == ActionType.Bulk
|| ctx.ActionType == ActionType.Row;
}
...
}
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
Example
Using the SetRepositoryType(Type repositoryType) Method
Sets the repository type dynamically to the given type for the current collection.
Method Syntax
Example
Accessing a Repository in Code
To help with accessing a repository (default or custom) Umbraco UI Builder has an IRepositoryFactory you can inject into your code base. This includes a couple of factory methods to create the repository instances for you. Repositories should only be created via the repository factory as there are some injected dependencies that can only be resolved by Umbraco UI Builder.
Using the GetRepository<TEntity, TId>() Method
Creates a repository for the given entity type. Umbraco UI Builder will search the configuration for the first section/collection with a configuration for the given entity type. Then it will use that as a repository configuration.
Method Syntax
Example
Using the GetRepository<TEntity, TId>(string collectionAlias) Method
Creates a repository for the given entity type from the collection with the given alias.
Method Syntax
Example
[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; }
}
{
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;
}
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; }
...
}
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 => {
...
}
);
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"
}
...
}
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"
};
}
}
}
public class MyController : Controller
{
private readonly Repository<Person, int> _repo;
public MyController(IRepositoryFactory repoFactory)
{
_repo = repoFactory.GetRepository<Person, int>("person");
}
}
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
Media
Name
Alias
Settings
Name
Alias
Members
Name
Alias
Workspace Views Aliases
Content
Name
Alias
Media
Name
Alias
Members
Name
Alias
ContentTypes
Name
Alias
Section Aliases
Name
Alias
Tree Aliases
Name
Alias
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:
Configuration Options
Option
Description
Required
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 %}
Controlling the Action Result
By default, actions return an ActionResult, but you can return other types by changing the Action<> generic argument.
ActionResult - Standard result with a boolean Success value.
FileActionResult - Returns a file stream or bytes and triggers a download dialog.
Capturing Settings for an Action
Sometimes, you need to collect user input before performing an action. You can achieve this by using the Action<> base class with an additional TSetting generic argument.
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.
Adding an Action to a Collection
Actions are added via the settings.
Using the AddAction<TMenuActionType>() Method
Adds an action of the specified type to the collection.
Method Syntax
Example
Using the AddAction(Type actionType) Method
Adds an action of the specified type to the collection.
Method Syntax
Example
Using the AddAction(IAction action) Method
Adds the given action to the collection.
Method Syntax
Example
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.
Child Collection Groups
Defining a Child Collection Group
You can define a child collection group by calling one of the AddChildCollectionGroup methods on a given collection config builder instance.
Using the AddChildCollectionGroup() Method
Adds a child collection group to the current collection with the specified name and default icon.
Method Syntax
Example
Using the AddChildCollectionGroup() Method with Custom Icon
Adds a child collection group to the current collection with the specified name and custom icon.
Method Syntax
Example
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.
Defining a Context App
You can define a context app by calling one of the AddContextApp methods on a
Events
Configuring event handlers in Umbraco UI Builder.
Umbraco UI Builder triggers different notification events during operation, allowing customization of default behavior.
Registering Event Handlers
Umbraco UI Builder follows the for event registration.
Define a notification event handler for the target event:
Register the event handler in
// 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...
}
}
forms
Translation
translation
Getting Started
contentIntro
Redirect URL Management
contentRedirectManager
Content
mediaFolderBrowser
Welcome
settingsWelcome
Examine Management
settingsExamine
Published Status
settingsPublishedStatus
Models Builder
settingsModelsBuilder
Health Check
settingsHealthCheck
Getting Started
memberIntro
Content
umbContent
Info
umbInfo
Content
umbContent
Info
umbInfo
Content
umbContent
Info
umbInfo
Design
design
List View
listView
Permissions
permissions
Templates
templates
Content
content
Media
media
Settings
settings
Packages
packages
Users
users
Members
member
Content
content
Media
media
Members
member
Member Groups
memberGroups
Forms
ConfirmAction
Set whether a confirm dialog should display before performing this action.
No
Name
The name of the action.
Yes
Alias
A unique alias for the action.
Yes
Icon
An icon to display next to the action’s name.
Yes
Execute
The method that runs for the given list of entities.
Adds a context app with the specified name and default icon.
Method Syntax
Example
Using the AddContextApp() Method with Custom Icon
Adds a context app with the specified name and custom icon.
Method Syntax
Example
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
Example
Using the AddContextAppBefore() Method with a Custom Icon
Adds a context app with the specified name and custom icon before another context app specified by its alias.
Method Syntax
Example
Using the AddContextAppAfter() Method
Adds a context app with the specified name and default icon after another context app specified by its alias.
Method Syntax
Example
Using the AddContextAppAfter() Method with a Custom Icon
Adds a context app with the specified name and custom icon after another context app specified by its alias.
Method Syntax
Example
Changing a Context App Alias
Using the SetAlias() Method
Sets the alias of the context app. By default, an alias is automatically generated from the context app's name. You can use the SetAlias method to specify a custom alias.
Method Syntax
Example
Changing a Context App Icon Color
Using the SetIconColor() Method
Sets the context app icon color to the given color. The available colors are: black, green, yellow, orange, blue or red.
Method Syntax
Example
Changing Context App Visibility
Context app visibility is controlled by a delegate that takes a ContextAppVisibilityContext instance. This method contains a Source property which holds a reference to the source object that the Workspace View is being displayed on (i.e., an IContent instance). It also holds a reference to a UserGroups collection of the currently logged-in user's user groups. You can use these values to determine when the context app should be displayed.
By default, context apps are pre-filtered to only appear on the tree they are defined in. This default behavior is combined with the SetVisibility configuration to control visibility.
Using the SetIconColor() Method
Defines the visibility of the context app based on a delegate expression.
Method Syntax
Example
Adding a Collection to a Context App
Context apps can consist of one or more collections. If a context app contains multiple collections, the collection list views will be displayed in tabs within the context app.
Using the AddCollection<>() Method
Adds a collection to the current context app with the specified names, descriptions, and default icons. Each collection requires an ID field and a foreign key field, linking to Umbraco node UDI values. For more details, see the Collections article.
Method Syntax
Example
Using the AddCollection<>() Method with Custom Icon
Adds a collection to the current context app with the specified names, descriptions, and custom icons. Each collection requires an ID field and a foreign key field, linking to Umbraco node UDI values. For more details, see the Collections article.
Triggers when Save is called before persisting the entity. The notification contains an Entity property with Before and After values, providing access to the previous and updated entities. Modify the After entity to persist changes. If the Cancel property of the notification is set to true then the save operation will be canceled and no changes will be saved.
Example
Using the EntitySavedNotification()
Triggers when the repository Save method is called and after the entity has been persisted. The notification contains an Entity property with Before and After inner properties. These properties provide access to a copy of the previously persisted entity (or null if a new entity) and the updated entity that´s saved.
Example
Using the EntityDeletingNotification()
Triggers when the repository Delete method is called and before the entity is deleted. The notification contains an Entity property providing access to a copy of the entity about to be deleted. If the Cancel property of notification is set to true then the delete operation will be cancelled and entity won't be deleted.
Example
Using the EntityDeletedNotification()
Triggers when the repository Delete method is called and after the entity has been deleted. The notification contains an Entity property providing access to a copy of the entity that´s deleted.
Example
Using the SqlQueryBuildingNotification()
Triggers when the repository is preparing a SQL query. The notification contains the collection alias + type, the NPoco Sql<ISqlContext> object, and the where clause/order by clauses. These will be used to generate the SQL query.
Example
Using the SqlQueryBuiltNotification()
Triggers when the repository has repaired a SQL query. The notification contains the collection alias + type, the NPoco Sql<ISqlContext> object and the where clause/order by clauses that was used to generate the SQL query.
Example
Repository Events Validation
From version 15.1.0, complex server-side validation can be added to a collection using the CancelOperation method of the notification.
contextAppConfig.AddCollection<Comment>(
p => p.Id,
p => "Comment",
"Comments",
"A collection of comments",
collectionConfig => {
// Collection configuration here
}
);
contextAppConfig.AddCollection<Comment>(
p => p.Id,
"Comment",
"Comments",
"A collection of comments",
"icon-chat",
"icon-chat",
collectionConfig => {
// Collection configuration here
}
);
public class MyEntitySavingEventHandler : INotificationHandler<EntitySavingNotification> {
public void Handle(EntitySavingNotification notification)
{
// Handle the event here
}
}
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"));
}
}
}
Editors
Configuring the editor of a collection in Umbraco UI Builder.
An editor is the user interface used to edit an entity. It consists of tabs and property editors.
A collection editor
Configuring an Editor
The editor configuration is a sub-configuration of a Collection config builder instance and is accessed via the Editor method.
Using the Editor() Method
Accesses the editor configuration for the specified collection.
Method Syntax
Example
Adding a Tab to an Editor
Using the AddTab() Method
Adds a tab to the editor.
Method Syntax
Example
Configuring a Sidebar to a Tab
A sidebar is a smaller section displayed on the right side of the main editor. It can contain fieldsets and fields, similar to tabs, but with limited space. The sidebar is ideal for displaying entity metadata.
Using the Sidebar() Method
Configures the sidebar for the tab.
Method Syntax
Example
Setting the Visibility of a Tab
Using the SetVisibility() Method for Tabs
Determines the visibility of the tab at runtime.
Method Syntax
Example
Adding a Fieldset to a Tab
Using the AddFieldset() Method
Adds a fieldset to a tab.
Method Syntax
Example
Setting the Visibility of a Fieldset
Using the SetVisibility() Method for Fieldsets
Determines the visibility of a fieldset at runtime.
Method Syntax
Example
Adding a Field to a Fieldset
Using the AddField() Method
Adds a property field to the editor.
Method Syntax
Example
Changing the Label of a Field
By default, Umbraco UI Builder converts property names into readable labels by splitting camel case names. You can override this behavior by setting an explicit label.
Using the SetLabel() Method
Sets a custom label for a field.
Method Syntax
Example
Hiding the Label of a Field
Sometimes, a field works better without a label, especially in full-width layouts.
Using the HideLabel() Method
Hides the field label.
Method Syntax
Example
Adding a Description to a Field
Using the SetDescription() Method
Adds a description to the field.
Method Syntax
Example
Changing the Data Type of a Field
By default, Umbraco UI Builder assigns a suitable Data Type for basic field types. However, you can specify a custom Data Type.
Using the SetDataType() Method
Assigns an Umbraco Data Type by name or ID.
Method Syntax (by name)
Example
Method Syntax (by ID)
Example
Setting the Default Value of a Field
Using the SetDefaultValue() Method
Sets a static default value.
Method Syntax
Example
Using the SetDefaultValue() Method (Function-Based)
Defines a function to compute the default value at the time of entity creation.
Method Syntax
Example
Making a Field Required
Using the MakeRequired() Method
Marks a field as required.
Method Syntax
Example
Validating a Field
Using the SetValidationRegex() Method
Applies a regular expression for field validation.
Method Syntax
Example
Making a Field Read-only
Using the MakeReadOnly() Method
This method makes the current field read-only, preventing any user modifications in the UI. Once applied, the field's value remains visible but cannot be edited.
Method Syntax
Example
Using the MakeReadOnly(Func<TValueType, string>) Method
This method makes the current field read-only, preventing user edits in the UI. Additionally, it allows specifying a custom formatting expression, which determines how the field value is displayed as a string.
Method Syntax
Example
Using the MakeReadOnly(object dataTypeNameOrId) Method
This method makes the current field read-only, preventing user edits in the UI. Additionally, it allows specifying a Data Type name or ID to determine how the field should be rendered when in read-only mode.
Method Syntax
Example
Using the MakeReadOnly(Predicate<>) Method
This method makes the current field read-only in the UI if the provided runtime predicate evaluates to true, preventing user edits.
Method Syntax
Example
Using the MakeReadOnly(Predicate<>, Func<>) Method
This method makes the current field read-only in the UI if the provided runtime predicate evaluates to true, preventing user edits. It also allows specifying a custom formatting expression to render the field’s value as a string.
Method Syntax
Example
Using the MakeReadOnly(Predicate<>, Func<>) Method
This method makes the current field read-only in the UI if the provided runtime predicate evaluates to true, preventing user edits. It also allows specifying a Data Type name or ID to use when the field is in read-only mode.
Method Syntax
Example
Setting the Visibility of a Field
Using the SetVisibility() Method for Fields
Controls field visibility at runtime.
Method Syntax
Example
The Basics
An overview of the basics of configuring a collection in Umbraco UI Builder.
A collection configuration in Umbraco UI Builder defines how collections are structured and displayed in the backoffice. This guide covers the core concepts, with additional options available in other configuration sections.
Defining a Collection
A collection is defined using the AddCollection method on a or parent configuration instance.
Trees
Configuring and customizing Trees to organize and manage the backoffice interface effectively.
A tree is a hierarchical structure that organizes sections into sub-sections. It appears in the main side panel of the Umbraco interface. In Umbraco UI Builder, each section can only have one tree definition, but you can use folder nodes to organize the tree.
Configuring a Umbraco UI Builder Section Tree
The tree configuration for Umbraco UI Builder sections is part of the config builder and is accessed via its Tree
Using the AddCollection() Method
Adds a collection to the given container with the specified names, description, and default icons. The ID property must be defined.
Method Syntax
Example
Using the AddCollection() Method with Icons
Adds a collection to the given container with the specified names, description, and icons. The ID property must be defined.
Method Syntax
Example
Changing a Collection Alias
Using the SetAlias() Method
Sets the alias of the collection.
Optional: When creating a new collection, an alias is automatically generated from the supplied name for you. To customize the alias, the SetAlias method can be used.
Method Syntax
Example
Changing a Collection Icon Color
Using the SetIconColor() Method
Sets the collection icon color to the given color. The available options are black, green, yellow, orange, blue, or red.
Method Syntax
Example
Defining an Entity Name
In Umbraco, every entity is expected to have a name property. To ensure the Umbraco UI Builder knows which property to use, you must specify it.
If the entity lacks a dedicated name property, you can define how to construct a name using other properties. This is done using either the SetNameProperty or SetNameFormat methods on a Collection config builder instance.
Using the SetNameProperty() Method
Specifies the entity property to use as the name, which must be of type string. This property serves as the label in trees and list views, appears in the editor interface header, and is automatically included in searchable properties. It is also used as the default sorting property.
Method Syntax
Example
Using the SetNameProperty() Method with Custom Heading
Specifies which property of your entity should be used as the name property and defines a custom heading for the list view column. The property must be of type string.
Setting a name property ensures its value is displayed as the label for the entity in trees and list views. It will also be editable in the editor interface's header region.
Additionally, the property is automatically added to the searchable properties collection and used as the default sort property.
Method Syntax
Example
Using the SetNameFormat() Method
Defines a format expression to dynamically generate a label for the entity in trees and list views.
This method is used when there is no single name property available on the entity. As a result, none of the default behaviors of the SetNameProperty method, such as automatic sorting, searching, or header editing, will apply.
Method Syntax
Example
Defining a Default Sort Order
Using the SetSortProperty() Method
Specifies the property used to sort the collection, with the default sort direction set to ascending.
Method Syntax
Example
Using the SetSortProperty() Method with Sort Direction
Defines the property of the entity to sort by, based on the specified sort direction.
Method Syntax
Example
Defining Time Stamp Properties
Using the SetDateCreatedProperty Method
Defines the property of the entity to use as the date created field. The property must be of type DateTime. When specified, this field will be automatically populated with the current date and time when a new entity is saved via the repository.
Method Syntax
Example
Using the SetDateModifiedProperty Method
Defines the property of the entity to use as the date modified field. The property must be of type DateTime. When specified, this field will be updated with the current date and time whenever the entity is saved via the repository.
Method Syntax
Example
Configuring Soft Deletes
By default, entities deleted via the Umbraco UI Builder repository are permanently removed from the system. The SetDeletedProperty method marks records as deleted without removing them. This retains them in the data repository while hiding them from the UI.
Using the SetDeletedProperty() Method
Defines the property of the entity to use as the deleted flag. The property must be of type boolean or int. When set, delete actions will mark the entity as deleted by setting the flag instead of removing the entity.
For boolean properties, the flag is set to True when deleted. For int properties, the flag is set to a UTC Unix timestamp representing the deletion date. Additionally, fetch actions will automatically exclude deleted entities.
Method Syntax
Example
Disabling Create, Update, or Delete Features
Using the DisableCreate() Method
Disables the option to create entities within the current collection. Entities can still be created programmatically, after which editing is allowed through the UI.
Method Syntax
Example
Using the DisableCreate() Method with Conditions
Disables entity creation within the current collection if the specified runtime predicate evaluates to true. Entities can still be created programmatically, after which editing is allowed in the UI.
Method Syntax
Example
Using the DisableUpdate() Method
Disables the option to update entities within the current collection. Entities can be created, but further editing is not permitted
Method Syntax
Example
Using the DisableUpdate() Method with Conditions
Disables the option to update entities within the current collection if the specified runtime predicate evaluates to true. Entities can be created, but further editing is not permitted.
Method Syntax
Example
Using the DisableDelete() Method
Disables the option to delete entities within the current collection. This is useful when data needs to be retained and visible. For more information, see the Configuring Soft Deletes section.
Method Syntax
Example
Using the DisableDelete() Method with Conditions
Disables the option to delete entities within the current collection if the specified runtime predicate evaluates to true. This is useful when data needs to be retained and visible. For more information, see the Configuring Soft Deletes section.
Method Syntax
Example
Using the MakeReadOnly() Method
Marks the collection as read-only, disabling all Create, Read, Update, and Delete (CRUD) operations via the UI.
Method Syntax
Example
Using the MakeReadOnly() Method with Conditions
Marks the collection as read-only if the specified runtime predicate evaluates to true. This disables all Create, Read, Update, and Delete (CRUD) operations via the UI.
Method Syntax
Example
Setting Collection Visibility
Using the SetVisibility() Method
Sets the runtime visibility of the collection.
Method Syntax
Example
Changing a Collection Connection String
By default, Umbraco UI Builder uses the Umbraco connection string for its database connection. You can override this by calling the SetConnectionString method on a Collection config builder instance.
Using the SetConnectionString() Method
Defines the connection string for the collection repository.
This method defines the structure and behavior of a tree within a section.
Method Syntax
Example
Adding a Tree to an Existing Section
To add a tree to an existing section, use one of the AddTree methods from the WithSection config builder.
Using the AddTree() method
This method adds a tree to the current section, specifying its name and icon.
Method Syntax
Example
Grouping Trees with AddTree() Method
This method adds a tree to the current section under a specified group.
Method Syntax
Example
Using AddTreeBefore() to Position a Tree
This method adds a tree to the current section before the tree with the specified alias.
Method Syntax
Example
Using AddTreeAfter() to Position a Tree
This method adds a tree to the current section after the tree with the specified alias.
Method Syntax
Example
Changing the Tree Icon Color
Using the SetIconColor() Method
This method changes the color of the tree’s icon. The available options are black, green, yellow, orange, blue, or red.
{% hint style="warning" %} Only trees in existing sections have an icon. Trees in Umbraco UI Builder sections display the tree contents directly. {% endhint %}
Method Syntax
Example
Adding a Group to a Tree
Using the AddGroup() Method
This method adds a group to the current tree with the specified name.
{% hint style="warning" %} Only trees in Umbraco UI Builder sections support groups. {% endhint %}
Method Syntax
Example
Adding a Folder to a Tree or Group
Using the AddFolder() Method
This method adds a folder node inside a tree or group, using the default folder icon. For more details, see the Folders article.
Method Syntax
Example
Using the AddFolder() Method with Custom Icon
This method adds a folder with a specified icon inside a tree or group. For more details, see the Folders article.
Method Syntax
Example
Adding a Collection to a Tree or Group
Using the AddCollection<>() Method
This method adds a collection to the current tree or group, specifying its names, descriptions, and default icons. The ID property must be defined. For more details, see the Collections article.
Method Syntax
Example
Using the AddCollection<>() Method with Icons
This method adds a collection to the current tree or group, specifying its names, descriptions, and custom icons. The ID property must be defined. For more details, see the Collections article.
This method starts a sub-configuration for an existing tree with the specified alias.
Method Syntax
Example
Adding a Context App to an Existing Tree
Using the AddContextApp() Method
This method adds a context app with the specified name and default icon. For more details, see the Context Apps article.
Method Syntax
Example
Using the AddContextApp() Method with Custom Icon
This method adds a context app with the specified name and custom icon. For more details, see the Context Apps article.
Method Syntax
Example
Adding a Context App Before or After Another Context App
Using the AddContextApp() Method Before Another Context App
This method adds a context app with the specified name and default icon before the specified context app alias. For more information, see the Context Apps article.
Method Syntax
Example
Using the AddContextApp() Method with Custom Icon Before Another Context App
This method adds a context app with the specified name and custom icon before the specified context app alias. For more information, see the Context Apps article.
Method Syntax
Example
Using the AddContextApp() Method After Another Context App
This method adds a context app with the specified name and default icon after the specified context app alias. For more information, see the Context Apps article.
Method Syntax
Example
Using the AddContextApp() Method with Custom Icon After Another Context App
This method adds a context app with the specified name and custom icon after the specified context app alias. For more information, see the Context Apps article.