Trees
A guide to creating a custom Tree in Umbraco
To create a working Tree in the Backoffice, you need to understand three things:
Populating Trees - How to populate a Tree with data.
Displaying Trees - How to display Trees and connect them to Menus to appear in the Section Sidebar or elsewhere.
Trees and Workspaces - How to navigate to Workspaces by clicking Menu Items.
Populating Trees
Trees get their data from a Repository. The Repository implements methods to return Tree Items and is referenced by the Tree Manifest via repositoryAlias.
Register the Repository
{
type: 'repository',
alias: 'My.Tree.Repository',
name: 'My Tree Repository',
api: () => import('./my-tree.repository.js'),
}Repository Implementation
Create a Repository that implements the TreeRepository interface. The interface below is simplified for clarity and omits return types and arguments. See full interfaces in the UI API Documentation
For detailed implementation guidance, see:
Tree Repository - Full repository implementation with static data example.
Tree Models -
UmbTreeItemModelandUmbTreeRootModelinterfaces.
Displaying Trees
Tree Manifest
Register your tree with a Manifest. The repositoryAlias links to how the Tree gets its data:
Tree Item Manifest
Tree-items define how individual items render. Use kind: 'default' for standard rendering:
Standalone Rendering
Trees can be rendered directly in custom components using the <umb-tree> element:
Connecting to a Menu
Trees can also provide hierarchical data to Menu Items, which display the navigation you see in the Backoffice Section Sidebar. To register your Tree-based Menu Item use the kind: 'tree' in the Menu Item Manifest.
Examples of built-in Menus include:
Content -
Umb.Menu.ContentMedia -
Umb.Menu.MediaAdvanced Settings -
Umb.Menu.AdvancedSettings
See Menu Items (Tree kind) and Section Sidebar for the complete setup.
Trees and Workspaces
When users click a Tree Item, Umbraco navigates to a Workspace to edit that item. The entityType in your Tree Items must match the meta.entityType in your Workspace Manifest.
See Trees & Workspaces for setup details and troubleshooting.
Further Reading
Umbraco UI Examples - Trees - Working examples in the Umbraco repository.
Workspaces - Creating Workspace extensions.
Last updated
Was this helpful?