Members
# content_type
Methods
# getField(uid) → {Object}
Gets the field object for the saved data, which allows you to interact with the field.
This object will have all the same methods and properties of extension.field.
Note: For fields initialized using the getFields function, the setData function currently works only for the following fields: as single_line, multi_line, RTE, markdown, select, number, boolean, date, link, and extension of data type text, number, boolean, and date.
Parameters:
| Name | Type | Description |
|---|---|---|
uid |
string
|
Unique ID of the field |
options.useUnsavedSchema |
boolean
|
If set to true, the field will get the unsaved field |
Field object
Object
Example
var field = entry.getField('field_uid');
var fieldSchema = field.schema;
var fieldUid = field.uid;
var fieldData = field.getData();
# onChange(callback)
The field.onChange() function is called when another extension programmatically changes the data of the current extension field using the field.setData() function. This function is only available for extension fields that support the following data types: text, number, boolean, or date.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function
|
The function to be called when an entry is edited/changed. |
# onPublish(callback)
The onPublish() function executes the callback function every time an entry has been published with the respective payload.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function
|
The function to be called when an entry is published. |
# onSave(callback)
This function executes the callback function every time an entry is saved.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function
|
The function to be called when an entry is saved. |
# onUnPublish(callback)
The onUnPublish() function executes the callback function every time an entry has been unpublished with the respective payload.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function
|
The function to be called when an entry is un published. |