I'm trying to get a list of tags available but I keep ending up with an Array of 0
Example code:
private List<String> tagsList = new ArrayList<String>();
try{
ResourceResolver resourceResolver = getRequest().getResourceResolver();
// Session session = resourceResolver.adaptTo(Session.class);
TagManager tagManager = resourceResolver.adaptTo(TagManager.class);
Resource resource = resourceResolver.getResource("/etc/tags/bmi");
Tag[] pageTags = tagManager.getTags(resource);
for(Tag tag : pageTags){
tagsList.add(tag.getTitle());
}
} catch(Exception e) {
LOG.error("Error getting tags",e);
throw new ServletException(e);
}
All the tags live under /etc/tags/bmi. I'm not sure why I'm not seeing an Array of Tags being returned.
Any help is greatly appreciated.
Thanks,
-Dean
Solved! Go to Solution.
Views
Replies
Total Likes
Hi
Please have a look at documentation for some help:-
Link:- https://docs.adobe.com/docs/en/aem/6-1/develop/tags/building.html
//Building Tagging into an AEM Application
Link:- https://helpx.adobe.com/experience-manager/using/tagmanager.html
// Using of Tagmanager API
Link:- http://experience-aem.blogspot.in/2013/11/aem-cq-56-new-tag-tree-tab-in-sidekick.html
// To add new tags or remove tags for a page, multiple clicks are involved in openingSidekick -> Page Tab -> Page Properties -> Basic -> Tags
I hope this would help you.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
Hi
Please have a look at documentation for some help:-
Link:- https://docs.adobe.com/docs/en/aem/6-1/develop/tags/building.html
//Building Tagging into an AEM Application
Link:- https://helpx.adobe.com/experience-manager/using/tagmanager.html
// Using of Tagmanager API
Link:- http://experience-aem.blogspot.in/2013/11/aem-cq-56-new-tag-tree-tab-in-sidekick.html
// To add new tags or remove tags for a page, multiple clicks are involved in openingSidekick -> Page Tab -> Page Properties -> Basic -> Tags
I hope this would help you.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
Views
Likes
Replies