exclude specific block on the contentarea when rendering


The content area property allows two types of blocks. One of the block has got icon in it's partial view.
When I render the content area property in the following way, I am missing that icon on the block.

Is there anyway to exclude the block type in the contentarea when rendered on the view so that I can render the block type with icon separately as a partial view?

Name = "Response",
GroupName = SystemTabNames.Content,
Order = 30)]
[AllowedTypes(new[] { typeof(Block2), typeof(Block1) })]
public virtual ContentArea ResponseContentArea { get; set; }

@Html.PropertyFor(m => m.CurrentPage.ResponseContentArea)

Oct 13, 2016 12:44

One option would be to implement a custom contentarea renderer as per the following blog post: http://joelabrahamsson.com/custom-rendering-of-content-areas/

Otherwise you can always get the items in the contentarea by using the Contents property (ContentArea.Contents): http://world.episerver.com/documentation/class-library/?documentId=cms/7/ab3bbfb1-5fdd-6650-3ebf-5e59f8f98490

Oct 13, 2016 12:51

How about using tags to render, and only have a renderer for the tag for one of the block types?

Oct 15, 2016 14:21
* 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.