Query for descendants (at any level) of type “Office Department”
I managed to implement a custom IDynamicRootQueryStep that returns the Guid for all the 8 nodes that I need in the picker, but the UI renders like this:
Could it be that you need to return a UDI for dyamicpath over GUID.. eg umb://document/{guid}
I think there is a utlity method in lit/c# in core to get that from a guid,
But reminded me: re flattened.. even allowed templates don’t use the flattened view they used to.. instead making the editor go searching across folders for a choice of two allowed templates. (where once two clicks selected my template, now it takes 3+ (and more if I have to expand lots of nesting to find my template)
Apologies, I was guessing on the dynamicpath… as Guids don’t indicate document/media/member…
The old mntp covered all the types.. now I think the v17 approach is content picker/media picker/member picker separate pickers.
Could it be that providing all the parent nodes in IDynamicRootQueryStep then looks in the child folders of those nodes? So in your example you’d pass back Göteborg, Stockholm, and Jönköping?
The backend interface (IDynamicRootQueryStep) uses an ICollection<Guid> return type because query steps can conceptually resolve multiple branch paths or unions (for example, finding matching categories or multi-site fallback roots).
And for your use case I think the dynamic root part should be returning your 3 guids..
`Goetborg, Stockholm, Jonkoping"
However, the UI tree-picker implementation then expects a single starting node.. it can’t display multiple trees… Hence why it only shows your first tree from Offices when you include those.
(built in core are singular though.. nearest or furthest… prob due to that)
So think you are railing against a UI contraint.
You can however, create a custom property editor that also implements dynamic root setting and then either try and reuse multiple .. or just a your own ui at this point .
{
alias: "startNode",
label: "Start node",
description: "Limit picker to a specific node and its descendants",
propertyEditorUiAlias: "Umb.PropertyEditorUi.ContentPicker.Source",
},
gets you a dynamicPath config option on the propertyEditor
As far as I know, the Content Picker accepts one root path, like the ‘start node’. It’s not meant for aggregating multiple children of multiple root nodes. It’s just a filter to scope the ‘root node’. So if multiple nodes match the dynamic root, it will just take the first.
Contentment has very nice pickers where you can use queries to get what you want to do. Umbraco has a concept of Property Editor data sources, but that is pretty limited, so I’d go for contentment.
Contentment is a great shout.. though probably would still benefit from a tree picker for the use case here.. as we have duplicated department names in the offices..
A flat list would have to concatenate {office}{department} ?
It’s fair to say that contentment is not ‘native’, but on the other hand, it exists for a long time and has a proven track record. And Lee is now even an Umbraco employee So I wouldn’t worry too much about using it; we’re using it in almost all our projects.
The closest is the is the Property Editor data sources that I mentioned before. That’s mainly used for Umbraco compose and has no real implementations yet, but it is exactly what Contentment more or less does: feed a property editor based on a data source.