Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Restict Content Area to Only Allow Global Blocks


Hi guys,

Wondering if anyone has come across a method of restricting a content area to only allowing global/shared blocks in the content area. 

Any help would be appreciated.


Jul 18, 2018 18:34

Hi David

Have you considered using an IValidator<T>? 


Jul 18, 2018 21:27

I was going to answer the same about IValidator of T, but would be great to have more human friendly UI -> that dropping is enabled only for allowed blocks. this might involve spelling some dojo magika..

Jul 19, 2018 5:55

Hi guys,

Yes sorry I should've expanded on my question really.. was more wondering whether there were a way to remove the "Create a new block" option within the content area - and hence restricting it down to only allow shared blocks essentially. 


Jul 19, 2018 10:30

Hi David.

Other Episerver friends of ours has done something you'll find useful.

Try and have a look here:

Please note; it does not mean editor simply can't create a new block through the Asset pane, under "For This Page". 

/Casper Aagaard Rasmussen

Edited, Jul 19, 2018 10:55

Yes you could do something like this

[AllowedTypes(new []{ typeof(XBlock), typeof(YBlock)})]
public virtual ContentArea MainContentArea { get; set; }


solution is to add an interface to the block:

public class SliderBlock : INotAvailableContent {}

The interface and descriptor:

public interface INotAvailableContent { }

public class NotAvailableContentDescriptor : UIDescriptor<INotAvailableContent> { }

The ContentArea defintion:

[AllowedTypes(RestrictedTypes = new[] { typeof(INotAvailableContent) })]
public virtual ContentArea MainContentArea { get; set; }

Now you can easy add INotAvailableContent for ContentAreas and blocks to avoid them.

Edited, Aug 07, 2018 14:58

Hey David

This may be exactly what you are looking for:


Aug 09, 2018 14:00
* 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.