Breakout Editor Meta Definition and Script Files

The breakout custom attribute editor requires its own JSON meta definition file and script file.

The meta definition file references the JavaScript and CSS resources that the editor requires, as in this example.

  "name": "Magical Custom Editor Breakout",
  "description": "An editor with unicorn images",
  "resources": {
    "scripts": [
    "styles": [

The script file implements the init function to initialize the custom attribute editor with server-side logic or resources. This example adds options for the breakout editor not included in the editor_definition of the component's meta definition file. It also includes a reference to CSS resources that are required if the list of unicorns includes more than 20 items.


'use strict';
var URLUtils = require('dw/web/URLUtils');
module.exports.init = function(editor) {
 var optionsConfig = editor.configuration.options.config;
 var optionsInit = [
 // Add more unicorns programmatically
 editor.configuration.options.put('init', optionsInit);
 // Provide `baseUrl` to the static assets/content
 editor.configuration.put('baseUrl', URLUtils.staticURL('/experience/editors/com/sfcc/').https().toString());
 // Conditionally add a resource which is only required in case of a lot of unicorns
 if ((optionsConfig.length + optionsInit.length) > 20) {
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.