A literal holds a constant (fixed) value. HTL has four kinds.
Boolean
Represents an on/off condition.
${true} ${false}
Numbers
HTL supports only positive integers — no negative or floating-point numbers.
${11}
Strings
Hold text values.
${'mytext1'} ${"mytext2"}
<p>${'John\'s car is "awesome !", Maria said'}</p>
These escape sequences are allowed in HTL strings:
\\ | Backslash |
\' | Single quote |
\" | Double quote |
\t | Tab |
\n | New line |
\r | Carriage return |
\f | Form feed |
\b | Backspace |
\uXXXX | The Unicode character given by four hexadecimal digits |
Arrays
An array is an ordered, indexed collection of values under one name.
<!--/* element at index 2 */-->
${utilityArray[2]}
<!--/* an array of 5 numbers */-->
${[1,2,3,4,5]}
<!--/* print an array's names separated by ':' */-->
${utilityArray.names @ join=':'}
<!--/* access an array dynamically */-->
<ul data-sly-list="${utilityArray.names}">
<li>${properties[item]}</li>
</ul>