Hide default category property



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.

Apr 12, 2023 13:14

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 

geta-optimizely-categories/HideCategoryEditorDescriptor.cs at master · Geta/geta-optimizely-categories (github.com) 

   /// <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;
Edited, Apr 12, 2023 13:29

Thanks. I tried it in an Alloy solution here, and it works there. So I guess it must be something in our solution that is causing it not to work.

Apr 12, 2023 15:14
* 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.