November Happy Hour will be moved to Thursday December 5th.

Support IList for content properties

Fixed in

EPiServer.Labs.LanguageManager 5.2.0

(Or a related package)

Created

Sep 08, 2023

Updated

Oct 13, 2023

State

Closed, Acceptance tests pass


Description

IList for content properties is now supported:

Block example:

namespace AlloyTemplates.Models.Blocks
{
    /// <summary>
    /// Used to insert a link which is styled as a button
    /// </summary>
    [ContentType(
    DisplayName = "List property block",
    GUID = "c36610cc-dd60-4b5a-a576-4d57450d457c")]
    public class ListPropertyBlock : BlockData
    {
        [CultureSpecific]
        [Display(
            Name = "List of stuff",
            GroupName = SystemTabNames.Content,
            Order = 200)]
        public virtual IList<StuffBlock> ListOfStuff { get; set; }
    }    
    [ContentType(
        AvailableInEditMode = false,
        GUID = "6ce91413-c53d-459f-be43-e351bc4e5c70")]
    public class StuffBlock : BlockData
    {
        [CultureSpecific]
        [Display(
            Name = "String property stuff",
            GroupName = SystemTabNames.Content,
            Order = 100)]
        public virtual string StringProperty { get; set; }        
        [CultureSpecific]
        [Display(
            Name = "List of test",
            GroupName = SystemTabNames.Content,
            Order = 200)]
        public virtual IList<NestedStuffBlock> ListOfTest { get; set; }
    }    
    [ContentType(
        AvailableInEditMode = false,
        GUID = "6ce91413-c53d-459f-be43-e351bc4e5c77")]
    public class NestedStuffBlock : BlockData
    {
        [CultureSpecific]
        [Display(
            Name = "String property 2",
            GroupName = SystemTabNames.Content,
            Order = 100)]
        public virtual string StringProperty { get; set; }
    }
}