Try our conversational search powered by Generative AI!

Content types with multiple UIDescriptorRegistration

Vote:
 

After following this guide to set tree icons I really like how I can just add an interface to a content type to set the icon.

So with this class I can just add the IUseSettingsTreeIcon to any content type.

 
[UIDescriptorRegistration]
public class SettingsTreeIconDescriptor : UIDescriptor
{
    public SettingsTreeIconDescriptor()
    {
        IconClass = DefaultContentIcons.ActionIcons.Settings;
    }
}
public interface IUseSettingsTreeIcon
{
}

I also liked this trick to force all properties view and it would be nice if I could just add this interface to the content types where I want this behaviour.

[UIDescriptorRegistration]
public class AllPropertiesViewDescriptor : UIDescriptor
{
    public AllPropertiesViewDescriptor() : base("dijitIcon")
    {
        // Make form editing the default for this content type
        DefaultView = CmsViewNames.AllPropertiesView;
    }
}
public interface IUseAllProperitesView
{
}

Is there a good way to achive this without having to define an own UIDescriptorRegistration for every different content type?

#187389
Jan 22, 2018 13:34
* 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.