Questions tagged [htl]

HTL (HTML Templating Language, formerly known as Sightly) - the Apache Sling XSS-aware template language

HTL (HTML Templating Language, formerly known as Sightly) is an XSS-aware templating language that was introduced in Adobe Experience Manager 6.0 and later donated to Apache Sling. Its distinguishing features are a tight integration with Sling and helping make your HTML immune to cross-site scripting by supplying sensible defaults and anti-XSS filters.

94 questions
1
vote
2 answers

How can I set data-sly-test case insensitive in sightly?

I need to set the data-sly-test in order to achieve 'true' as test result comparing two strings in case insensitive way.
true
where value of properties.jcr:language is 'EN'.…
user5542056
  • 55
  • 2
  • 7
0
votes
2 answers

How to add the Author/Edit mode condition in sightly/HTL for class attribute values.?

I have a HTML snippet as below.
.... ...
I have wrote it in below way. but it doesn't shows the entire dive in wcmmode=disabled.
krish
  • 469
  • 1
  • 15
  • 34
0
votes
2 answers

Adding "defer" attribute to clientLib script tags in AEM 6.1

How would I add the defer attribute to our script tags? We get them via the clientLib tag call in our head.html but there's not much out there for AEM and how to easily add the defer tag to our scripts.
Nate
  • 333
  • 3
  • 15
0
votes
1 answer

HTL Sightly for passing param and specifying a bundle

Is it possible to pass a variable to the data-sly-use statement using HTL Sightly Use API while also specifying a bundle? For example with the helper package…
Cris Rockwell
  • 904
  • 2
  • 16
  • 30
0
votes
1 answer

How can one access a resource via node UUID in Sightly/HTL?

As of HTL 1.4, it is possible to access a resource if you know its path by using data-sly-use, e.g.: data-sly-use.item="/content/my_nodes/node1" However, if one does not have the path to the resource, but only the node's jcr:uuid (automatically…
Spinner
  • 732
  • 1
  • 6
  • 21
0
votes
2 answers

Sightly condition check

Below is my code. actually i am displaying list of children (in 2 sections) on click in header navigation.
0
votes
2 answers

Unable to fetch page properties in the head script

I am trying to get a page property in the head of my page basically to make it universally available so that the front end developers can use it in their scripts as they will. This is on AEM 6.3. And I've already tried to include a script in the…
Vishal--JAVA--CQ
  • 188
  • 1
  • 2
  • 18
0
votes
3 answers

problem in automatically installing bundle in crxde

I am building maven project in Eclipse it should automatically update the snapshot bundle in crxde but its not. I am manually installing the bundle in crxde to check page changes. please suggest how crxde should automatically update osgi…
0
votes
1 answer

AEM Tag picker widget on a page

I am working on a functionality where the user selects a Tag from a namespace and clicks a button. Currently, we have a text box where user needs to enter the tag ID. But its not convenient for them to know the tagID. Is there any way to create a…
Riju Mahna
  • 6,718
  • 12
  • 52
  • 91
0
votes
3 answers

Functionality of data-sly-test for given example in image

Please find the below snippet. Can any one explain above functionality for the data-sly-test. How it will work condition here for image??
Naveen.P
  • 61
  • 1
  • 6
0
votes
1 answer

How to modify @Inject getter (passed from AEM ) in interface

@Inject String getGoToFavoritesButtonLink(); is in the interface and not class. I want to modify its value to be something like getGoToFavoritesButtonLink().concat(".html"); so that URL can be externalized. How can this be done without any…
Rashmi Ks
  • 35
  • 8
0
votes
0 answers

Why is Sling ignoring the "adaptable" parameter of HTL's data-sly-use?

In 2017 functionality was added to Apache Sling and HTL to allow use of the Use API with a different adaptable (such as a resource resolver, or a child resource) rather than the default backing resource or request. Feike Visser provided an example…
Spinner
  • 732
  • 1
  • 6
  • 21
0
votes
2 answers

how to get session object from resource resolver factory?

@Component public class AddNode { @Reference static ResourceResolverFactory resolverFactory; static Session session; public static void main(String[] args) throws Exception { ResourceResolver resourceResolver =…
Kumar Ramela
  • 11
  • 1
  • 6
0
votes
1 answer

AEM 6.4 - How to read multifield from design dialog using Sling model?

I have created a component with a design dialog and policy. I can read basic properties of the design dialog but am confused on what to do with multifield. Design dialog (check headerPrimaryLinks)
Evan Borden
  • 11
  • 1
  • 5
0
votes
1 answer

Best practice to render empty alt attribute of img tags on sightly

Writing img tags with alt attributes is expected for good code practices, but sightly automatically skips empty attributes. How to render empty alt attributes in sightly? Having this case, where image.alt is empty Actual result: Expected result:
Ferran
  • 1
  • 2