Hi,
So I have a ContentReference property where the editor can pick images, videos, and an interface. I would like to force this property to have the image picker UI element in where there is a preview for an image since 98% of the time, there will be images there.
This is my property definition:
[Display(GroupName = CustomTabs.Media, Order = 103, Name = "Local media", Description = "Replaces the media block if set.")]
[AllowedTypes([typeof(IAmMedia), typeof(VideoData), typeof(ImageData)])]
[CultureSpecific(true)]
[UIHint(UIHint.Image)]
public virtual ContentReference? LocalMedia { get; set; }
The above will just display the generic content reference picker UI element. If I remove the types IAmMedia and VideoData from the allowedtypes, leaving everything else as is, the image thumbnail preview element is shown instead. It seems there is somewhere some hidden code determining what to show in the edit mode only depending on the allowed types for a property, very tricky to find.
Is there a way to force the image thumbnail dialog? I thought that was determined by the UIHint (I have also tried using the UIHint overload with presentationlayer.edit to no avail) I have tried looking at UIDescriptors or EditorDescriptors, but that entire system is completely filled with magic string classes and generic dictionaries of objects with yet more magic strings configuring the javascript dojo interface, so I have no idea where to begin.
Ideally I would like to be able to configure what to return for the thumbnail myself somehow, but first I would just like to say "show the thumbnail here if you can find it" (cause I would expect there are some error handling there already in case of a broken/missing image).