HTL (sightly) script to populate tags Name | Community
Skip to main content
Satish_Jadhav
New Participant
June 3, 2020
Solved

HTL (sightly) script to populate tags Name

  • June 3, 2020
  • 3 replies
  • 3293 views

Is there HTL (sightly) tag to populate tag name (page property tag) without using JAVA Models ?

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 khamat_bn

@satish_jadhav 

Yes its possible to use without java. We have to use data-sly-list attribute and should pass the tag property name in expression.After that via item object we can fetch each tags from string array.

Note that tag property should have name cq:tags 

Happy coding,

~BK 🙂

3 replies

khamat_bn
khamat_bnAccepted solution
New Participant
June 4, 2020

@satish_jadhav 

Yes its possible to use without java. We have to use data-sly-list attribute and should pass the tag property name in expression.After that via item object we can fetch each tags from string array.

Note that tag property should have name cq:tags 

Happy coding,

~BK 🙂

BrianKasingli
New Participant
June 4, 2020

It's possible. From not using Sling Models, you can try to use JavaScript-Use or Java-Use API to expose an array of Tag Objects.

Ravi_Pampana
New Participant
June 4, 2020

Hi,

 

You can iterate through tag values using below syntax

 

<ul class="two" data-sly-list="${properties['cq:tags']}">
<li>${item}</li>
</ul>

 

cq:tags in jcr:content

 

Will output as below

Hope this helps!