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

Date type required in AEM HTL / Sightly date formatter

I've seen that since AEM 6.3, date formatting has been natively supported in the markup, like so: ${ 'dd~MMMM-yyyy' @ format=currentPage.jcr:created } (Reference: https://github.com/adobe/htl-spec/blob/master/SPECIFICATION.md#1222-dates ) I have…
ronx
  • 89
  • 2
  • 7
3
votes
0 answers

Creating a custom adaptive form component - that will submit and store data

Is it possible to create a new adaptive form component in HTL/sightly or extend an existing component? Basically just trying to create a dropdown component (or any other component) that populates its values from a java model and will be saved to crx…
sootballz
  • 31
  • 4
3
votes
1 answer

Pass parameters to data-sly-include in sightly/HTL

I have a piece of Sightly/HTL code as follows -
3
votes
2 answers

HTL -how to display a page on another page like popup / modal

I'm trying to use existing page (selected with pathbrowser from TouchUI) as a popup / modal on my HTL page. Is there a way of adding / injecting HTML from different file using sightly ? It's more about sightly and rendering that html on the page…
fernando
  • 814
  • 1
  • 9
  • 24
3
votes
4 answers

How to create a radio button in aem 6 touch dialog

I am having a touch UI component for which I am creating a dialog in AEM 6. I have a requirement to create 2 radio buttons in the touch dialog and if either one of them are selected, the corresponding value of the selected radio button should be…
Surya Chandra
  • 1,561
  • 5
  • 27
  • 42
2
votes
1 answer

Sightly: Iterating over a list and using its index to print another list (not nested, just sharing the index)

I have 2 lists in sightly. list1 and pathList inside object allList At the place where I had written "XXXXXXXXX", I need to place…
Akshay Rathnavas
  • 338
  • 4
  • 16
2
votes
5 answers

How to check for undefined variable property in HTL (AEM)?

Newbie to AEM here. Say I have:
夢のの夢
  • 5,054
  • 7
  • 33
  • 63
2
votes
1 answer

Get path for clientlibs files

I'm trying to preload assets like explained here. I've included these in /apps/foundation/components/page/head.html:
Tiberiu Maxim
  • 1,474
  • 14
  • 24
2
votes
2 answers

HTL Access Property Without Getter

I'm writing an AEM component and I have an object being returned that is a type from an SDK. This type has public properties and no getters. For simplicity, it might be defined like this: class MyItem { public String prop1; public String…
Jamie Counsell
  • 7,730
  • 6
  • 46
  • 81
2
votes
2 answers

AEM sightly how to reuse variables

can I use variables in another file that I'm including? in my HTL (file1.html) I have: Can I use myVar in file2.html ? I'm not getting any…
fernando
  • 814
  • 1
  • 9
  • 24
2
votes
1 answer

How to compare two strings in Sightly/HTL? (AEM 6.2)

I have created a simple dropdown with two options Yes and No which return the values of "true" and "false"…
Archit Arora
  • 2,508
  • 7
  • 43
  • 69
2
votes
1 answer

sightly/HTL/AEM: using "tel:" on an href parameter (a tag) doesn't work

help please. I have this very simple code. my link it works fine if using "mailto" as target but when using "tel", the href tag is empty (inspected the tag using firebug…
mrjayviper
  • 2,258
  • 11
  • 46
  • 82
2
votes
1 answer

AEM : How to Iterate a HTL list in reverse order?

Using data-sly-list the elements are printed in the order as they are. Is there a way in HTL using which we can print the list items in reverse order? e.g. if the list contains 1,2,3,4 I want to print 4,3,2,1.
2
votes
3 answers

How can I preserve null alt attributes in Sightly?

I'm working on an ADA level AAA compliant site. For accessibility purposes, you are supposed to use an empty string for the alt attribute alt='' if the image has no semantic value (a background pattern, etc) so that screen readers don't read the…
jbaker
  • 68
  • 1
  • 7
2
votes
2 answers

Run time variable is not resolved inside style element in Sightly in AEM 6.2

I am trying to provide the background image to a div by creating a variable in sightly. I am reading a property with sightly and when I supply this to style tag, it does not work. here is the html
Ngupta
  • 319
  • 4
  • 19
1
2 3 4 5 6 7