Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

Error when rending ContentArea property inside a block

$
0
0

I feel I may be going the wrong way about this, but I have a block that I want to be able to put many images into one place. I defined a property of type ContentArea and restricted it to only allow images. Is this the best/recommended way to allow multiple images? The problem I am running into is trying render the images. If I use either Html.PropertyFor or Html.DisplayFor, both return this error:

The model item passed into the dictionary is of type 'EPiServer.Core.ContentArea', but this dictionary requires a model item of type 'GLHOMES.Website.Features.ShowcaseBlock.ShowcaseBlock'

Do I need to use a view model to load the content referenced in the ContentArea first, and and render them from that? Is this the right approach to support multiple images in a single property? Would IList<ContentReference> work better?


Viewing all articles
Browse latest Browse all 9076

Trending Articles