I know it is possible to use block types as property types as per http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=71005.
Is it possible though to have a page property that is a list of blocks? I have tried these 2 things, but got exceptions in both cases:
[Display(Name = "Test block list", GroupName = SystemTabNames.Content, Order = 40)]public virtual BlockType [] TestBlockList { get; set; }
[Display(Name = "Test block list", GroupName = SystemTabNames.Content, Order = 40)]public virtual IList<BlockType> TestBlockList { get; set; }
Exception I got was saying "Type 'BlockType[]' could not be mapped to a PropertyDefinitionType".
What is an EPiServer 7 to handle this? A page property which is a list of composite objects (blocks).
I think you're looking for a ContentArea property, this allows you to add a collection of Content Items. You could add validation to it to ensure that only specific Blocks can be added by an editor.
I know it is possible to use block types as property types as per http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=71005.
Is it possible though to have a page property that is a list of blocks? I have tried these 2 things, but got exceptions in both cases:
[Display(Name = "Test block list", GroupName = SystemTabNames.Content, Order = 40)]
public virtual BlockType [] TestBlockList { get; set; }
[Display(Name = "Test block list", GroupName = SystemTabNames.Content, Order = 40)]
public virtual IList<BlockType> TestBlockList { get; set; }
Exception I got was saying "Type 'BlockType[]' could not be mapped to a PropertyDefinitionType".
What is an EPiServer 7 to handle this? A page property which is a list of composite objects (blocks).