Do we have any attribute for JSP similar to data-sly-element | Community
Skip to main content
cnur24357457
Level 2
June 21, 2017
Solved

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

  • June 21, 2017
  • 4 replies
  • 2891 views

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>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by VeenaVikraman

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

Thanks

Veena

4 replies

VeenaVikraman
Community Advisor
Community Advisor
June 21, 2017

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

cnur24357457
Level 2
June 21, 2017

Thanks Veena.

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

VeenaVikraman
Community Advisor
VeenaVikramanCommunity AdvisorAccepted solution
Community Advisor
June 21, 2017

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

Thanks

Veena

smacdonald2008
Level 10
June 21, 2017

That syntax only works in HTL - not JSP