November Happy Hour will be moved to Thursday December 5th.

Make it easier to register a custom editor wrapper module directly on the EditorDescriptor

Fixed in

EPiServer.CMS.UI 11.3.0

(Or a related package)

Created

Feb 16, 2018

Updated

Feb 26, 2018

Area

CMS UI

State

Closed, Fixed and tested


Description

If you need to register a custom editor wrapper for your editor, quite a few steps are involved.

First, you need to to add the wrapper key in the editor descriptor.

 
metadata.CustomEditorSettings["uiWrapperType"] = "customwrapper"; 

Then, you need to have a module initializer where you register your amd module for your key.

 
define([ 
    "dojo/_base/declare", 
    "epi/_Module" 
], function (declare, _Module) { 
 
    return declare([_Module], { 
 
        initialize: function () { 
            // summary: 
            //Initializes the module. 
            // tags: 
            // public 
 
            this.inherited(arguments); 
 
            this.resolveDependency("epi.cms.contentediting.EditorFactory")
                .registerEditorWrapper("customwrapper", "my-addon/CustomEditorWrapper"); 
        } 
    }); 
}); 

Now, if you instead register it on the "uiWrapper," it will be automatically loaded at runtime.

 
metadata.CustomEditorSettings["uiWrapper"] = "my-addon/CustomEditorWrapper";