If the custom editor that you need to add to your editor registry has the same name as an existing editor in your application, you can create a unique namespace for your custom editor. This lets you override an existing editor in the Experience Manager installation with a custom editor.

You do not need to edit every occurrence of the existing editor in cartridge templates to refer to the custom editor. Once the existing Experience Manager editor is overridden with a custom editor, all the mappings that exist in cartridge templates work as if the custom editor has been mapped in place of an editor in the Experience Manager installation.

Follow these steps to override an existing editor.

  1. Run the following command to export the editor registry of your deployed application: runcommand.bat|sh IFCR exportContent editors <directory>, where <directory> indicates the directory on the file system to which the editors registry should be exported.

    For example:

    runcommand.bat IFCR exportContent editors D:\backup\editors
  2. Navigate to the D:\backup\editors directory.

  3. If you have not done so already, create a namespace folder for your custom editors that have the same names as existing editors in your registry.

    For example, \editors\custom

  4. In the namespace folder, create a folder for your custom editor. Remember the folder must have the custom editor's name.

    For example if you want to override StringEditor in Experience Manager (editors\StringEditor) with a custom StringEditor then create a folder named editors\custom\StringEditor

  5. Add a JSON file, _.JSON with your editor's configuration to the folder. The ecr:type must be editor; config is optional.

    For example:

    {
        "ecr:type":"editor",
    }
  6. Add the editor.js and editor.html files for your editor to the custom editor folder.

  7. Copy the editor.js, editor.html, and _.json files from the custom editor folder editors/<namespace>/<custom editor> and paste them into the existing editor folder editors/<editor>.

    For example, copy the editor.js, editor.html, and _.json files from the <app dir>/config/import/editors/custom/StringEditor folder to the <app dir >/config/import/editors/StringEditor folder.

  8. Run the following command to import the updated editor registry of your deployed application: runcommand.bat|sh IFCR importContent editors <directory>, where <directory> indicates the directory on the file system from which editors registry should be imported.

    For example:

    runcommand.bat IFCR importContent editors D:\backup\editors
  9. Clear the browser cache and restart Experience Manager. The system begins using the custom editor in place of the existing editor.

    For example, the system starts picking custom StringEditor in place of the existing StringEditor.


Copyright © Legal Notices