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
The current implementation of XPath is suboptimal and will be removed entirely in a future version. It is currently obsolete and scheduled for removal in v14.
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
![](https://docs.umbraco.com/~gitbook/image?url=https%3A%2F%2F65787334-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F8h0xdoteqcFVV1pGZgk0%252Fuploads%252Fgit-blob-a5b012f17c6bcfca3f16dc0fddffb11f528d8e36%252FMultinode-Treepicker-DataType-8_1.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=3b2000bc&sv=1)
Content Example
![](https://docs.umbraco.com/~gitbook/image?url=https%3A%2F%2F65787334-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F8h0xdoteqcFVV1pGZgk0%252Fuploads%252Fgit-blob-83e70feba9066b10000e56a160a433fa2a88c44f%252FMultinode-Treepicker-Content-v8.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=9501239&sv=1)
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