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

Try our conversational search powered by Generative AI!

Metadatastore does not return editor settings for block properties

Fixed in

EPiServer.CMS.UI 9.5.0

(Or a related package)

Created

Dec 16, 2015

Updated

May 02, 2016

Area

CMS UI

State

Closed, Fixed and tested


Description

1.Add code like this:

    [ContentType]
    public class MyPageType : PageData
    {
        public virtual MyBlock Block { get; set; }
    }
 
    [ContentType]
    public class MyBlock : BlockData
    {
        public virtual string MyString { get; set; }
    }
 
    [EditorDescriptorRegistration(TargetType=typeof(MyBlock))]
    public class MyBlockEditorDescriptor : EditorDescriptor
    {
        public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
        {
            base.ModifyMetadata(metadata, attributes);
            metadata.EditorConfiguration["baseClass"] = "my-css-class";
        }
    }

2. Create a page of the new type MyPageType.

3.Inspect the html element for the block when editing the page.

Expected: The element has the custom css class "my-css-class."
Actual: No custom css class. The standard "dijitLayoutContainer" class is used instead.