Singlenode Treepicker OR Content Picker where you can define the content type?
Hi!
Is there an editor which only allows a single item to be selected of a specific type?
The "Content Picker" editor allows you to set a "Start node" but not limit the content types allowed for picking.
The "Multinode Treepicker" does set the content type allowed ("Allow items of type"), and you can set the maximum number of items to 1 - this is my current working method, but it seems strange to allows return an array of one.
I would use a MNTP as you are currently doing, but you can override the Property Value Converter to change the return type of a property based on it's configuration.
There is a SuperValueConverters package that can do this for you (although when I last used it there was a small bug that means it breaks some core behaviour for special cases).
Singlenode Treepicker OR Content Picker where you can define the content type?
Hi!
Is there an editor which only allows a single item to be selected of a specific type?
The "Content Picker" editor allows you to set a "Start node" but not limit the content types allowed for picking.
The "Multinode Treepicker" does set the content type allowed ("Allow items of type"), and you can set the maximum number of items to 1 - this is my current working method, but it seems strange to allows return an array of one.
Thoughts?
Cheers!
Rich
I would use a MNTP as you are currently doing, but you can override the Property Value Converter to change the return type of a property based on it's configuration.
There is a SuperValueConverters package that can do this for you (although when I last used it there was a small bug that means it breaks some core behaviour for special cases).
Thanks,
Nik
OH interesting - so, for example, instead of returning the array you can say return the first item of the array? Will explore, ty Nik!
Have a look at the code in this repo :-)
https://github.com/callumbwhyte/super-value-converters/blob/v9/dev/src/Our.Umbraco.SuperValueConverters/ValueConverters/SuperValueConverterBase.cs
is working on a reply...