1

I need to set the data-sly-test in order to achieve 'true' as test result comparing two strings in case insensitive way.

<div data-sly-test="${ properties.jcr:language == 'en'}">true</div>

where value of properties.jcr:language is 'EN'. data-sly-test in this case returns 'false' but I need that the result is 'true'.

Is it possible ?

Thanks in advance

Vlad
  • 10,602
  • 2
  • 36
  • 38
user5542056
  • 55
  • 2
  • 7

2 Answers2

3

It can actually be done in HTL/Sightly by forcing your variable to uppercase and then comparing:

<div data-sly-test="${ properties.jcr:language.toString.toUpperCase == 'EN' }">true</div>
Vlad
  • 10,602
  • 2
  • 36
  • 38
0

According to the specification and my experience, you can't do this. Use sling or slice models or the plain use api for your logic.

d33t
  • 1,143
  • 6
  • 15