NEWCKEditor 5 Long-term Support is here! Find out more
Sign up (with export icon)

MergeFieldDefinition

Api-interface icon interface

The definition of a single merge field.

Depending on the type, some of the properties may not be relevant:

  • For text merge fields, the id, label, and defaultValue properties are used.
  • For block merge fields, the id, label, height, and defaultValue properties are used.
  • For image merge fields, the id, label, height, width, and defaultValue properties are used.

Properties

  • Chevron-right icon

    Default value of the merge field.

    It is used if a value for given merge field has not been provided in a data set and in the default values preview mode.

  • Chevron-right icon

    height : number | undefined

    The height of the non-text merge field in pixels.

    It is used only for merge fields of type block and image. If unset, the default height for block is 120 pixels and for image - 400 pixels.

    Defaults to 120 (for block)/ 400 (for image)

  • Chevron-right icon

    id : string

    The unique identifier of the merge field.

    If label is not specified, the ID will be used as a label.

    The list of allowed characters includes: a-z, A-Z, 0-9, _, ., and -.

  • Chevron-right icon

    label : string | undefined

    The human-readable label of the merge field.

    It is displayed by the feature's UI and inside the editing area.

  • Chevron-right icon

    type : MergeFieldType | undefined

    The type of the merge field. It determines how the merge field is rendered in the editor editing area.

    Possible options are text (meaning the merge field will be inline), block and image.

    Defaults to 'text'

  • Chevron-right icon

    width : number | undefined

    The width of the image merge field in pixels.

    It is used only for merge fields of type image. If unset, the default width is 400 pixels.

    Defaults to 400