Templates

Documents and Comparisons can be templated using Liquid syntax. To create a template, visit this page.

For example, to display the question for a comparison as an h3 element (HTML header, level three), you could use the following template:

  <h3>{{comparison.question}}</h3>


Here is an example of a document template:

template-example


You can also supply additional properties for a document (or comparison) in the “Template Properties” section of the document’s (or comparison’s) edit form. These should be supplied in JSON format. Your Mechanical Turk HIT page can then use these attributes by accessing “properties” on the comparison or document as follows.

Here is the example from above with an extra property, called “custom” added (the template property JSON looks like {"custom": "hello world"}):

  <h3>{{comparison.question}}</h3>
  <i>{{comparison.properties.custom}}</i>


Here is an example of template properties for a document:

template-property-example


You can preview your templates and properties to ensure that they display as expected.

For examples of setting up templates and properties via the API, see this page for comparisons and this page for documents.