HTL (sightly) script to populate tags Name | Community
Skip to main content
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

Ravi_Pampana
Community Advisor
Community Advisor
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!

BrianKasingli
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
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.

khamat_bn
khamat_bnAccepted solution
Level 4
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 🙂