Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

HTL in AEM | AEM Community Blog Seeding

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,162 likes

Total Posts

6,272 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,162 likes

Total Posts

6,272 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

04-01-2021

BlogImage.jpg

HTL in AEM by All AEM By Kiran Vedantam

Abstract

As you already know keeping the business logic separate from the view is the best practice which AEM suggests. In this post, we are going to discuss on the VIEW part which is HTML Template Language (HTL Formerly Known As Sightly).

Below is the list of HTL tags that can be used in different scenarios. Happy & fast coding 😁.
:
This tag is used to remove the current element, allowing only its children to be displayed.


Checking the mode in HTL: Below command checks if the mode = edit, if true shows the p tag.

This is EDIT Mode



Accessing a Model object in HTL:


Accessing Model values via Model object: The modelValue will generally be the dialog value authored.
${modelObject.modelValue}

Accessing List values from Model object:
Using LIST tag:
${listObject.firstListValue}

Using REPEAT tag:
${item.name}
Note: List needs a container [here the
tag] element and Repeat does not need it

Read Full Blog

HTL in AEM

Q&A

Please use this thread to ask the related questions.

AEM AEMEBlogSeeding Experience Manager