HTL Literals

HTL Literals

Literals holds a constant(fixed) value. It can be of 4 types mainly.

Boolean: Represents on off condition. It can be accessed as
${true} ${false}

Numbers: HTL Supports only positive digits , not negative numbers or floating.

Strings: Holds text values
${'mytext1'} ${"mytext2"}

For eg:
<p>${'John\'s car is "awesome !", Maria said'}</p>

Below special characters are allowed in HTL Strings.
\\ Backslash character
\' Single quote
\" Double quote
\t Tabulation
\n New line
\r Carriage return
\f Form feed
\b Backspace
\uXXXX (Unicode character specified by the four hexadecimal digits)

An array is a collection of values that can be represented with a common name. An array will have an index ans ordered.

//Array of 2 elements
// Array of 5 digits
//print an array by names separated by ':'
${utilityArray.names @ join=':'}

//Dynamically accessing Array
<ul data-sly-list="${utilityArray.names}">
    <li>${ properties[item]}</li>

No comments:

Post a comment