Hiding Episerver’s Category property

Do not confuse your editors. If they do not need the property, the do not need to see it!
Episerver has a lot of built-in properties, that are not used on all websites.

If they do not need the category property, hide it!

[EditorDescriptorRegistration(TargetType = typeof(CategoryList))]
public class HideCategoryEditorDescriptor : EditorDescriptor
{
    public override void ModifyMetadata(ExtendedMetadata metadata, 
        IEnumerable attributes)
    {
        base.ModifyMetadata(metadata, attributes);
        if (metadata.PropertyName == "icategorizable_category")
        {
            metadata.ShowForEdit = false;
        }
    }
}

Legg igjen en kommentar

Din e-postadresse vil ikke bli publisert. Obligatoriske felt er merket med *