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.

Tree

Configuring a Umbraco UI Builder Section Tree

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

Using the Tree() Method

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

Method Syntax

Example

Adding a Tree to an Existing Section

To add a tree to an existing section, use one of the AddTree methods from the 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.

Method Syntax

Example

Extending an Existing Tree

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

Using the WithTree() Method

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

Method Syntax

Example

Adding a Context App to an Existing Tree

Using the AddContextApp() Method

This method adds a context app with the specified name and default icon. For more details, see the 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.

Method Syntax

Example

Last updated

Was this helpful?