${properties.title}
Read a dialog value.
${item.text @ context='html'}
Render rich text safely.
${clientlib.css @ categories='…'}
Call a template.
the delimiter
an object HTL gives you
a member of it
${'a string'} ${42}
${true} ${[1, 2, 'three']}
${obj.key} // dot
${obj['key']} ${obj[keyVar]} ${arr[0]}
Works on strings, numbers, booleans, null, and Java enums.
escapes all HTML
safe rich markup, filtered
integers — 0 if it fails
escapes attribute characters
for href / src — validates; nothing if unsafe
inside a JS string
a JS identifier or number
inside a CSS string
a CSS value
var user = "${properties.name @ context='scriptString'}";
Escapes quotes and breakouts — the value stays a string. scriptToken is for a bare identifier or number.
.cmp-profile { color: ${properties.brandColor @ context='styleToken'}; }
Validates a CSS value — outputs nothing if it isn't one. styleString is for inside a CSS string.
${properties.tags @ join=' · '}
An array → a string, with your separator.
${'yyyy-MM-dd HH:mm' @ format=properties.published}
A date → text, in your pattern.
The block statements. data-sly-use to bring in logic, data-sly-test to show or hide, data-sly-list to loop, data-sly-resource / -include to compose, data-sly-template to reuse. The attributes that build the markup we've been filling with expressions.