Yes - the original MNTP in the older Umbraco versions was able (IIRC) to do that...
Unfortunately, the XPath you enter for the current one is only for selecting the parent node (i.e. the one whose children should be selectable) - however, there should be an additional Allow items of type setting, where you could put the region alias in... ?
Yeah true, i can at least limit the user to select the correct doctype. Ideally the user would just see a selection of items. As an alternative i could also filter by a property ("showInMntp"). It's hard finding workable examples?
Actually, I think you should take a look at the nuPickers collection of really awesome pickers.
For your use-case, you could create a picker using the Xml CheckBox Picker which would render a list of checkboxes for each document matching an XPath, e.g.: $site/configurationSettings/data/regions/region[showInMntp = 1] - you can even use your own macro to render their labels...
Or if it's a "pick only one" kind of picker, maybe use the Xml DropDown Picker ?
Filtering Umbraco.MultiNodeTreePicker2 by doctype alias
I have a MNTP that list my regions with the following xpath.
i have 2 doctypes that can be added as children of "regions" these are "region" & "globalRegion".
I'd like to be able to filter my xpath so that only "region" is displayed.
I'm sure in the past i could use something like "//region" and all "region" on the tree would be return.
Any ideas? 7.10.4
Hi Anthony,
Yes - the original MNTP in the older Umbraco versions was able (IIRC) to do that...
Unfortunately, the XPath you enter for the current one is only for selecting the parent node (i.e. the one whose children should be selectable) - however, there should be an additional Allow items of type setting, where you could put the
region
alias in... ?Hope that helps,
/Chriztian
Thanks Chriztian!
Yeah true, i can at least limit the user to select the correct doctype. Ideally the user would just see a selection of items. As an alternative i could also filter by a property ("showInMntp"). It's hard finding workable examples?
Actually, I think you should take a look at the nuPickers collection of really awesome pickers.
For your use-case, you could create a picker using the Xml CheckBox Picker which would render a list of checkboxes for each document matching an XPath, e.g.:
$site/configurationSettings/data/regions/region[showInMntp = 1]
- you can even use your own macro to render their labels...Or if it's a "pick only one" kind of picker, maybe use the Xml DropDown Picker ?
Cheers, /Chriztian
Excellent suggestion. There is probably a cleaner query but following xpath works on the Xml CheckBox Picker
Been meaning to explore this project for a while. I've ended up using the Dot Net Picker. Super simple setup.
https://github.com/uComponents/nuPickers/wiki/Data-Source-DotNet
is working on a reply...