Try our conversational search powered by Generative AI!

List of blocks as a page type property

Vote:
 

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).

#81563
Feb 19, 2014 13:36
Vote:
 

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.

 

 

#81567
Feb 19, 2014 15:04
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.