Expand my Community achievements bar.

SOLVED

Do we have any attribute for JSP similar to data-sly-element

Avatar

Level 3

When I use

<h2 class="${properties.testclass}" data-sly-element="${properties.tagType}">${properties.title}</h2> in my JSP code (In HTML it works fine)

Output

<h2 class="test" data-sly-element="h5">Title</h2>

Expected Output:

<h5 class="test" >Title</h5>

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

No!! (As far as I know ) Feike Visser​ should be the best person to answer this if my understanding is wrong

Thanks

Veena

View solution in original post

4 Replies

Avatar

Community Advisor

Hi

    Please be informed that data-sly attributes can be used only in context with HTL . That means , if you are writing your presentation logic in sightly , you are good to go and this will work like magic .

     As sightly was developed mainly for us to move away from the far old JSP , I would recommend you to move to HTL than trying this in JSP

I have found some interesting reading for you here AEM 6 Why Sightly?

Thanks

Veena

Avatar

Level 3

Thanks Veena.

I know moving to HTL solves the issue. My question was is it achievable with JSP?

Avatar

Correct answer by
Community Advisor

No!! (As far as I know ) Feike Visser​ should be the best person to answer this if my understanding is wrong

Thanks

Veena

Avatar

Level 10

That syntax only works in HTL - not JSP