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
2
votes
1 answer

Keep child elements when data-sly-test evaluates to false?

Examine this What we need when data-sly-test="${mybean.href}" evaluates to false, only hide the anchor tag, and not its child elements. The default behavior…
lance.dolan
  • 3,493
  • 27
  • 36
2
votes
1 answer

Is there a pattern for grouping templates via includes?

I'm creating a new project, and I'd like to namespace a few of my helpers for sightly. These helpers are "template.html files". I'm currently calling them with the normal pattern of:
Brodie
  • 8,399
  • 8
  • 35
  • 55
1
vote
1 answer

Difference between sightly and jsp?

Why is there a need to move away from JSP codes when the world doing just fine with it? When I ask the difference between JSP and sightly I only find the advantages of sightly but I want to how are they different fundamentally? What does it mean…
Vishal--JAVA--CQ
  • 188
  • 1
  • 2
  • 18
1
vote
1 answer

Access variables that are set in page level JSP, in data-sly-use javascript of components in AEM HTL?

In a page level component I have set a variable. Now I author a few component on the page. These components should have access to the stepIndex variable. The components are written in HTL and I want…
Oliver
  • 6,152
  • 2
  • 42
  • 75
1
vote
1 answer

Can I use other prefixes other than 'is' in WCMUsePojo boolean getters?

I've seen conventions in Java pojos that use can, has, and should instead of the usual is. However, in AEM 6.1 we have WCMUsePojo right? is works for sure, and I've tried has but hasn't worked. Is this a bug or WCMUsePojo never really intended other…
ronx
  • 89
  • 2
  • 7
1
vote
1 answer

How to access suffixes using HTL/Sightly?

TLDR: Create a new AEM page called "mypage.html". Supply suffixes in the URL. Pass this suffixes to an Sling servlet. The suffixes act as URL parameters. sample desired URL: http://localhost:4502/mypage.html/john/smith So I created a servlet (used…
mrjayviper
  • 2,258
  • 11
  • 46
  • 82
1
vote
1 answer

AEM 6.x: How to pass an HTL variable to clientlib/JS?

So I have the following lines which loads my javascript. I…
mrjayviper
  • 2,258
  • 11
  • 46
  • 82
1
vote
1 answer

AEM multifield data-sly-repeat ${item} not working

This has been driving me nuts - hoping someone can help me. I have a multifield component called 'books' with a single textfield: 'title'. Everything seems to be working; the dialog box contains the multifield then I add two title fields then enter…
user3870265
  • 63
  • 2
  • 8
1
vote
2 answers

AEM 6.3 - Sling Model not working

I am using a very basic Sling Model class which is not working at all. This is the class: package com.aem.sites.models.test; import org.apache.sling.models.annotations.Model; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import…
user972418
  • 817
  • 3
  • 25
  • 58
1
vote
3 answers

'tel' attribute not working in href of anchor tag in rich text editor in classic UI in AEM 6.1

I am using AEM 6.1 SP2 , I am trying to enable 'tel' attribute in the href of anchor tag to make the click to call functionality work. I have already added 'htmlRules' node and links node under htmlRules node with 'protocols' property as [http://,…
cqsapientuser
  • 65
  • 3
  • 12
1
vote
1 answer

How to write hidden input field in HTML Template Language (HTL)

What is the syntax to include hidden field in HTML Template Language (HTL)? In jsp we can write
surendrapanday
  • 770
  • 2
  • 9
  • 24
1
vote
1 answer

Set currentPage using dialog property in Adobe AEM

I am creating a menu component. Mouting a tree with the pages and its children.
    It's working fine, but I need to replace the currentPage using a property of my dialog…
Italo Pessoa
  • 179
  • 1
  • 12
1
vote
1 answer

Sling Sightly: property of children with Javascript USE API?

The Situation You are inside the JavaScript USE API for Sightly/HTL. use([], function () { //your code here return {}; }); You then get a reference to a child resource like this: var childRes = resource.getChild('my-child-node'); The…
lance.dolan
  • 3,493
  • 27
  • 36
1
vote
1 answer

HTL Language, string concatenation and ternary operator

I am using adobe AEM, and the HTL language. I am writing something like: ${properties.hash ? [model1.href,properties.hash] @ join='#' : model1.href} But doesn't works. I think it is a syntax problem.. But I am not able to solve the problem.
Labo29
  • 117
  • 3
  • 13
1
vote
2 answers

How to use an integer value in sightly to iterate loop as many time of value?

I want to iterate a loop based on Integer value in sightly like if integer value is 5 then loop will iterate five times. I know a way to do this using JSTL in jsp page :
ArpitBora
  • 590
  • 9
  • 24