SaaS CMS has officially launched! Learn more now.

Custom AvailableContentTypes attribute


Does anyone know if we can create a custom attribute to show/hide a page type that depends on a custom condition? I would like to have an attribute like:

public class ProductPage : StandardPage, IHasRelatedContent

Jul 09, 2019 1:36

Hi Francisco,

Yep. I wrote a blog post about a similar scenario. The post is about feature switching based on language but, as I say at the end, you can use any custom logic you like to decide whether to show the content type or not:

In short, you'd need to create an implementation of ContentTypeAvailabilityService which checks for the attrtibute and applies the relevant logic to determine whether the content type should be shown.

Jul 09, 2019 10:23
Francisco Quintanilla - Jul 09, 2019 23:58
Excellent post!
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.