Typedef

DataSetDefinition (merge-fields)

@ckeditor/ckeditor5-merge-fields/src/mergefieldsconfig

typedefobject

Filtering

Properties

  • id : string

    A unique identifier of the data set. It cannot start with $, as it is reserved for internal use.

  • label : string | undefined

    A human-readable label of the data set.

  • values : Record<string, MergeFieldDataSetValue>

    The data to be displayed in the editor in place of merge fields when the data set is previewed.

    The keys of this object are merge field IDs, while values are the merge field values, which can be strings or functions. If the value is specified as a function, it should return a string. The function will be evaluated each time the data set values are retrieved.

    const mergeFieldsConfig = {
    	dataSets: [
    		id: 'customDataSet',
    		values: {
    			companyName: 'CKSource',
    			productName: 'CKEditor 5'
    		}
    	]
    };