Expand my Community achievements bar.

AEM - HTL Block Statements | AEM Community Blog Seeding

Avatar

Administrator

BlogImage.jpg

AEM - HTL Block Statements by

Abstract

HTML Template Language (HTL) block statements are custom data attributes added directly to existing HTML. This allows easy and unobtrusive annotation of a prototype static HTML page, converting it to a functioning dynamic template without breaking the validity of the HTML code.

Block Overview
HTL block plugins are defined by data-sly-* attributes set on HTML elements. Elements can have a closing tag or be self-closing. Attributes can have values (which can be static strings or expressions), or simply be boolean attributes (without a value).

 
 
 
 
 
 
All evaluated data-sly-* attributes are removed from the generated markup.

Identifiers
A block statement can also be followed by an identifier:


The identifier can be used by the block statement in various ways, here are some examples:

${navigation.title}
${isEditMode}
${child.properties.jcr:title}
Hello World
 
 
Top top-level identifiers are case-insensitive (because they can be set through HTML attributes which are case-insensitive), but all their properties are case-sensitive.

Read Full Blog

AEM - HTL Block Statements

Q&A

Please use this thread to ask the related questions.



Kautuk Sahni
0 Replies