Add list support for content properties

Fixed in

EPiServer.CMS.Core 12.10.0

Created

Aug 24, 2022

Updated

Nov 22, 2022

Area

CMS Core

State

Closed, Acceptance tests pass


Description

Built-in support for list properties on content models was limited to primitive types such as string, number and ContentReference. List properties are now supported as individual properties (like int, string, XhtmlString etc) including Block types. You can now define properties on content models like:

public virtual IList<string> MyStrings {get; set;}
public virtual IList<TeaserBlock> MyTeasers {get; set;} 

where TeaserBlock in example above is a defined block in CMS, like:

[ContentType]
public class TeaserBlock : BlockData
{...}
  • Usage is tracked (soft link indexing) for items that can reference content (like IList<ContentReference>). 
  • Import/export of list definitions and data is supported.
  • New list properties are JSON-based (unless explicitly specified, for example, through BackingTypeAttribute).