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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Can we add multiple selectors using Sightly?

Avatar

Level 1

I am trying to add multiple selectors while using data-sly-resource. Code used ::

<div data-sly-resource="${currentPage.path @selectors=['form', 's1', 's2']}"></div>

It throws ClassCastException

java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to java.lang.String

Its working fine with single selector :: <div data-sly-resource="${currentPage.path @selectors='form'}"></div>

1 Accepted Solution

Avatar

Correct answer by
Level 6

Have you tried

<div data-sly-resource="${currentPage.path @selectors='form.s1.s2'}"></div>

??

 

/Ove

View solution in original post

4 Replies

Avatar

Correct answer by
Level 6

Have you tried

<div data-sly-resource="${currentPage.path @selectors='form.s1.s2'}"></div>

??

 

/Ove

Avatar

Level 1

This works but I need a combination of static and dynamic values.

Avatar

Employee

Not sure if it matters, but the documentation shows a space between the '@' and the word 'selectors':

http://docs.adobe.com/content/docs/en/aem/6-0/develop/sightly.html