Improves the presentation of ContentReference and Url properties in a Generic PropertyList by showing the content name or a preview if it's an image.
- ContentReference and Url properties are automatically detected
- Images are identified by the
UIHint
attribute with no additional configuration required
- The NuGet package can be installed from the [Optimizely NuGet feed] (https://nuget.optimizely.com/)
- See the installation details here: https://nuget.optimizely.com/package/?id=DoubleJay.Epi.EnhancedPropertyList
In CMS 12, to register you should call the AddEnhancedPropertyList
method in your startup class ConfigureServices
method::
public void ConfigureServices(IServiceCollection services)
{
services.AddEnhancedPropertyList();
}
Usage is then as simple as using the EnhancedCollectionEditorDescriptor
(DoubleJay.Epi.EnhancedPropertyList.EditorDescriptors
) opposed to the default CollectionEditorDescriptor
.
Your property should look like this:
[EditorDescriptor(EditorDescriptorType = typeof(EnhancedCollectionEditorDescriptor<Item>))]
public virtual IList<Item> Items { get; set; }
Based on two blog posts (one of which was my own!):