Try our conversational search powered by Generative AI!

AllowedTypes not working when applying for ContentArea

Vote:
 

Hi All,

I want to restrict user to select specific block when trying to insert it into ContentArea. I have tried below option but it doesn't seems to work :

  [Display(Order = 10, Name = "Add More Books")]
  [AllowedTypes(typeof(BooksBlock))]
      
  public virtual ContentArea AddMoreBooks { get; set; }

But it is not restriciting user for BooksBlock and user can select any available block. Please suggest how to restrict this. I also tried option where we can apply this setting at class level but that also didn't work (give below)

 //[AvailableContentTypes(Include = new[] { typeof(BooksBlock), })]

Episerver ver : 7.5

[Pasting files is not allowed]

#180799
Jul 26, 2017 16:00
Vote:
 

Hi, 

I just checked this and it worked. But I don't think so this functionality was available in version 7.5. If you upgrade to latest version, you'll definitely able to use AllowedTypes and RestrictedTypes attribute on a ContentArea property. Here is a detail description of how AllowedTypes work and what to expect. 

#180837
Jul 28, 2017 12:46
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.