Multinode Treepicker
Alias: Umbraco.MultiNodeTreePicker
Returns: IEnumerable<IPublishedContent>
Settings
The Multinode Treepicker allows you to configure the type of tree to render and what part of the tree that should be rendered. For content it allows you to select a dynamic root node based on the current document using the multinode tree picker.
Node type: set the type of node, the root node of the tree, or query for the root node
For querying for a root node, you can use dynamic placeholders in the XPath query, following the below sample queries
It is important to notice that all placeholders above act against published content only. So if you, therefore, try to fetch $parent
of the current document, then Umbraco will return that or its closest published ancestor. So in case, the parent is not published, it will try the parent of that parent, and so on.
Filter out items with type: allow or disallow tree nodes with a certain content type alias.
Enter typeAlias,altTypeAlias
to only allow selecting nodes with those alias'. Enter !typeAlias,altTypeAlias
to only allow selecting nodes not with those alias'.
Minimum/maximum number of items: set a limit on the number of items allowed to be selected.
Data Type Definition Example
Content Example
MVC View Example
Without Modelsbuilder
With Modelsbuilder
Add values programmatically
See the example below to see how a value can be added or changed programmatically. To update a value of a property editor you need the Content Service.
The example below demonstrates how to add values programmatically using a Razor view. However, this is used for illustrative purposes only and is not the recommended method for production environments.
Although the use of a GUID is preferable, you can also use the numeric ID to get the page:
If Modelsbuilder is enabled you can get the alias of the desired property without using a magic string:
Last updated