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.

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

Last updated

Was this helpful?