The reference syntax used for templates is a LiquidJS syntax. For more information about the LiquidJS syntax, see the Liquid reference guide.
The reference syntax is parsed to identify all the paths we need to solve with data fetched on-demand from Connect, and has the following limitations:
For example:
{{entity.name}}
There are no limitations. Output values can have values separated by filters with one or more arguments. For more information on filters, see the Supported Filters section.
For example:
{% for item in (valueStart..valueEnd) %}{{ item }}{{ item.<property> }}{% endfor %}{% for item in collection %}{{ item }}{% endfor %}
The following parameters are supported: reversed, offset and limit. For example:
{% for item in collection reversed %}{% for item in collection reversed offset: argument %}{% for item in collection reversed limit: argument %}{% for item in collection offset: argument %}{% for item in collection offset: argument reversed %}{% for item in collection limit: argument %}{% for item in collection limit: argument reversed %}
item.<property>
is a property that can be accessed only if it exists on that object.For example:
{% assign parentAlias = entity.parent %}{{ parentAlias }}{{ parentAlias.name }}
The same alias value can be reassigned. Its value will be overwritten, and block scoped/general scoped assignments are not differentiated.
The expression can be:
The boolean value/both expression parts are solved with data fetched from Connect. We can have multiple expressions (comparations) in a if tag using the 'and' and 'or' operators.
For example:
{% if entity.name == 'Awesome Title' %} or {% if entity.name != 'Awesome Title' %} or {% if isAwesome %} or {% if 'Awesome Title' == entity.name %}This is an awesome title.{% endif %}{% if line_item.grams > 20000 and customer_address.city == 'Ottawa' or false %}{% endif %}{% if entity.attributes['global']['FalseBooleanValue'] %} ... {% endif %}
{% if customer.tags contains 'VIP' or customer.email contains 'mycompany.com' %}{% endif %}
{% case entity.name %}{% when 'Instance' %}Instance!{% else %}Not an instance!{% endcase %}
Only the case expression is parsed, meaning that it will be solved with data fetched from Connect.
If inside the body of when, else branches there are reference paths (found as output values, or in assign operations, for, if etc) that have not been used outside it (this is their first appearance), these reference paths will not be solved with data fetched from Connect.
size
compact
reverse
first
last
uniq
sort
sort_natural
json *
raw
escape
escape_once
url_encode
url_decode
strip_html
newline_to_br
capitalize
upcase
downcase
strip
lstrip
rstrip
strip_newlines
floor
ceil
round
abs
The json filter is converting values to string as described in the official documentation.
It can be used on a reference that is a primitive (string, number, boolean, Date). For example:
{{entity.createdAt | json}} → This is a Date and will return "2022-04-14T10:08:09.937Z".
{{entity.slug | json}} → This is a string and will return "uptv-apple-season-1-55dfffac".
It can be used on a reference that is an array. For example:
{{entity.tags['Billboard 8:3'].properties.streams | json}} → It will return [object Object],[object Object],[object Object],[object Object].
It can be used on a reference that is an object, returning only the properties that were queried on that object.
Note that you cannot use filters with dot notation when you need to use the filter inside a tag. For example,
collection.size
is not supported. Use collection | size
instead.
{% if collection.size > 10 %}This is not supported!{% endif %}
Note: Other LiquidJS operations, such as cycle, tablerow, capture, increment, decrement, are not covered.
For more information about LiquidJS operations, see the Tags section of the LiquidJS documentation.
entity.tags['TimedTextEN'].<fields> → returns fields on the first file (source file or deliverable file) associated with this tag
entity.attributes['en_US']['**Designation1**'].<fields> → returns fields on the first file (source file or deliverable file) associated with this tag
File Designation
If inside a template exists:
but, If inside a template exists:
returns the properties.format.duration field on the file that is tagged with the tag
File
If inside a template exists:
but, If inside a template exists:
returns the properties.format.duration field on the file
entity.attributes['en_US'][‘File'].id → returns the file id
Reference
If inside a template exists:
entity.attributes['en_US'][‘Reference'] → returns the entity id
but, If inside a template exists:
returns the OBJECT representing the entity
AND
entity.attributes['en_US'][‘Reference'].attributes['en_US'][‘Attribute_value'] → returns the attributes['en_US'][‘Attribute_value'] on the entity
entity.attributes['en_US'][‘Reference'].id → returns the entity id
Connect builds the name of the deliverable file as the last element of the path (everything that is after the last “/” in path). As such, the file name cannot contain multiple “/” marks.