We’ve migrated our documentation to a new site, which means some URLs have changed.
Audience

Content widget template object

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

id

String

Identifier of the template object.

siteGroupId

String

Site group of this template object.

description

String

Short description of the template object.

settings

Object

Detailed settings for this template object, described below.

lastUpdatedBy

String

Email address of the last person to update the template object.

lastUpdatedAt

String (Date)

Time of the last update to the template object (ISO 8601 timestamp).

history

Array of Object

List of previous revisions.

Notes

  1. If lastUpdatedBy and/or lastUpdatedAt is 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.

  2. 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, siteGroupId and history. 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

type

String

Yes

The template type. Currently always "basic".

head

String

No

Declarations that will be added to the head of the iframe rendering the widget.

html

String

Yes

The actual template, using the

simple templating language

, which is an extension of HTML.

Last updated: