Make block available in edit mode just for a specific block type


I have made a carousel slider block in which I use slider item blocks. Right now, the slider item blocks are available from everywhere but I want to restrict it so that it is only available in the carousel slider block. How can this be done?

Jun 28, 2016 9:47

You can have a look at AllowedTypes attribute that might solve your problem. 

Jun 28, 2016 9:59

@Khurram Yeah, I am using that already but the slider item block still shows up for every content area without allowed types set. So I want to specify for the slider item block that it can only be added to the carousel slider block if that is possible.

Jun 28, 2016 11:25

The easiest way is probably to use RestrictedTypes on the content areas I'm afraid. Don't think you can specify that on the block...

[AllowedTypes(AllowedTypes = new [] { typeof(BlockData) }, RestrictedTypes = new [] { typeof(EditorialBlock) })]
public virtual ContentArea RelatedContentArea { get; set; }
Jun 28, 2016 14:12

RestrictedTypes is part of AllowedTypes attribute, that is what I meant when I said look into AllowedTypes attribute. It works with ContentArea and you can place any kind of content type including Blocktypes in Restricted types.

Jun 28, 2016 14:39

Hi Marcus, can you share the detailed process for creating the carousel slider block. I tried creating it by following this link , but i din't understand the procedure given. 

Jul 19, 2017 11:31
* 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.