Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Restricting content types in properties

Vote:
 

Hi,

For CMS 7.19 I need to restrict content types in properties and I know that you can use the AllowedTypes attribute but with 7.5 this does not work with base classes (typically I need this to work with base classes), does anyone know of a workaround for this limitation?

Thanks,

Mark

#173149
Dec 15, 2016 9:46
Vote:
 

Am not sure about if it can be done in the version you are using, but ...

Create an interface and put it on your content types that inherit from your base class. Create a UIDescriptor for the interface.

[UIDescriptorRegistration]
    public class IPageFooterlUIDescriptor : UIDescriptor<IPageFooter>
    {
        public IPageFooterlUIDescriptor()
            : base()
        {
            this.DefaultView = CmsViewNames.OnPageEditView;

        }
    }

After you have done that you can use the interface in the AllowedTypes attribute. 

#173157
Dec 15, 2016 13:15
* 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.