Inside my ContentArea, I am rendering Rows (RowBlock that contains a ContentArea only). Inside each row, I want to have one to four other blocks (of different types).
This works fine, but based on the number of blocks in a row, I want to load a different image size (most of the blocks have their teaser image). I could do this easily, if I were to use RenderPartial. In that case I would just pack up my ViewModel the way I want it and sing :). However, I need to render different types of blocks, so instead, I am using:
@{ Html.RenderContentData(@block, true); }
Block is of type SiteBlockData : EPiServer.Core.BlockData.
Is there a way to transfer the info about the size of the image or the image Url to the @block?
Do I have to use the alternative and check of which type is my block and use corresponding partial view?
Hi, I have the following scenario:
Inside my ContentArea, I am rendering Rows (RowBlock that contains a ContentArea only). Inside each row, I want to have one to four other blocks (of different types).
This works fine, but based on the number of blocks in a row, I want to load a different image size (most of the blocks have their teaser image). I could do this easily, if I were to use RenderPartial. In that case I would just pack up my ViewModel the way I want it and sing :). However, I need to render different types of blocks, so instead, I am using:
Block is of type SiteBlockData : EPiServer.Core.BlockData.
Is there a way to transfer the info about the size of the image or the image Url to the @block?
Do I have to use the alternative and check of which type is my block and use corresponding partial view?
Thank you in advance,
Marija