A content widget template object (or simply "template object") describes a transformation from widget content (JSON) to HTML. The transformation is formulated using a simple templating language. There is a basic user interface for editing template objects, but it is also possible to use the API directly.
A template object may have the following fields. If a field is not specified when the template object is created, its value will be null. If a field is not specified in an update, this field's value will not be changed. If a field is missing when read back from the server (in the response to a create, read or update), it means that its value is null.
|
Name |
Type |
Description |
|---|---|---|
|
|
String |
Identifier of the template object. |
|
|
String |
Site group of this template object. |
|
|
String |
Short description of the template object. |
|
|
Object |
Detailed settings for this template object, described below. |
|
|
String |
Email address of the last person to update the template object. |
|
|
String (Date) |
Time of the last update to the template object (ISO 8601 timestamp). |
|
history |
Array of Object |
List of previous revisions. |
Notes
-
If
lastUpdatedByand/orlastUpdatedAtis specified when the object is created, it has no effect. But if this is specified in an update, it has to match the current values for the update to succeed. This can be seen as a form of optimistic concurrency control. However, we cannot currently make any guarantees when there are several conflicting updates to the same object at the same time. -
The history field is only included in the response when individual objects are read or updated. It contains up to 50 previous revisions, in reverse chronological order. These revisions are themselves template objects – except that they do not contain the fields
id,siteGroupIdandhistory. The history field is ignored when a template object is created or updated.
A template settings object may have the following fields. Observe that at this level, if a field is not specified in an update, it is treated as null. Hence, the field's value may be changed.
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
String |
Yes |
The template type. Currently always "basic". |
|
|
String |
No |
Declarations that will be added to the head of the iframe rendering the widget. |
|
|
String |
Yes |
The actual template, using the simple templating language , which is an extension of HTML. |