September 24, 2026

HTL Syntax: Block Statements and Expressions

HTL is strict about syntax. There are two kinds of HTL syntax.

Block statements

Block statements are custom data attributes added directly to existing HTML. They are prefixed with data-sly.

Expression language

HTL expressions are evaluated at run time, and their value is injected into the outgoing HTML stream. Expressions are delimited by ${ and }.

  • Variables
  • Literals — booleans, numbers, strings, arrays
  • Operators — logical, conditional (ternary), comparison, grouping parentheses
  • Options — string formatting, internationalization, array join, display context

Back to the HTL tutorial index