Have a look at Geta.Optimizely.Categories repo they have an example here on how it can be achieved using an editor descriptor. I tested on a CMS12 site and looks to work
/// <summary>
/// Hides the categories drop down list for types where it is not needed
/// </summary>
[EditorDescriptorRegistration(TargetType = typeof(CategoryList), EditorDescriptorBehavior = EditorDescriptorBehavior.Default)]
public class HideCategoryEditorDescriptor : EditorDescriptor
{
public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
{
base.ModifyMetadata(metadata, attributes);
if (metadata.PropertyName == "icategorizable_category")
{
metadata.ShowForEdit = false;
}
}
}
Hi!
Does anyone know how to hide the default category property in Optimizely 12? The editor descriptor with the scaffold attribute works in older versions, but it doesn't seem to work in version 12.