Expand my Community achievements bar.

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

Avatar

Level 1

Space is not an issue. Tried it.