Custom Field Editors

A custom field editor is a browser pane that is displayed in place of one of the built-in content editor field types normally displayed by Content Studio. The pane can contain any valid combination of HMTL and Javascript code, and simply rendedrs whatever HTML is supplied in the usual way.

The pane's Javascript environment is similar to the extension Javascript environment described in Javascript Extensions, and provides the same general-purpose Javascript libraries. It does not, however, provide the same Content Studio-specific objects. When writing Javascript code for a field editor, there is only one built-in object that you can access with the require method. This object is called field-editor, and it represents the field itself. The field-editor.value() method can be used both to retrieve and set the value of the field.

In order to create a custom field editor you need to:

  1. Create an HTML file containing the field editor definition and deploy it to some location that is accessible from your Content Engine.

  2. Register the field editor you have created in one of your Content Engine configuration layers.

  3. Associate the registered field editor with one or more field definitions in your publication's content-type resource (see Using a Custom Field Editor).