Need to sort tags alphabetically. | Community
Skip to main content
ranadyutis95334
New Participant
January 14, 2016
Solved

Need to sort tags alphabetically.

  • January 14, 2016
  • 12 replies
  • 8873 views
There are 8 categories of tags that are included in the document library, which all correspond to tags in AEM. The child tags of those categories are displayed when you click the arrow on each category.

 

 

Apparently, these child tags are just shown in the order they appear in the JCR.  Is there a way to sort the child tags  in alphabetical order

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 edubey

Write a OSGI service to do this sorting.

There is one more approach you can try for:

Add a beforesubmit listener in your dialog box and before data gets saved in JCR, sort it with JS

12 replies

New Participant
February 5, 2018

Hi Harsha and Laura,

I basically modified the OOTB component under /libs/cq/gui/components/common/tagbrowser/tagbrowsercolumn/tagbrowsercolumn.jsp, by overlaying it to my folder and modified the renderer (pointing to my project folder) in tags picker component under /libs/cq/gui/components/common/tagspicker/render.jsp (overlayed this as well)

harsha006
New Participant
February 5, 2018

Hi Udaya,

Can you Please elaborate the solution which yo implemented because I have a required that while authoring ,the tags should appear in a sorted way.

New Participant
January 2, 2018

Udaya,

which component did you modify and was that a .js file or .jsp file?  we are having similar need to sort tags alphabetically.

I appreciate your feedback.

-Laura

New Participant
November 3, 2017

Found a solution by overlaying default OOTB tagspicker component. Just changed the fetch logic in tagsbrowser component and it worked!

New Participant
October 27, 2017

Hi edubey,

The solution given in this is not working

http://experience-aem.blogspot.in/2014/12/aem-6-sp1-touch-ui-sort-and-show-tags-in-alphabe tical-order.html

Screenshot

The other solution which you suggested : before submit does not hold good for my scenario. My scenario is to show the tags in alphabetical order (while authoring, so thats it's easy for authors). Storing is not a concern for me.

Another solution which you suggested is OSGI service. Can you please elaborate on that. Do u mean to write a service to reorder nodes and store it (in /etc/tags). Kindly advice.

My scenario is to just show the tags in alphabetical order while authoring.

edubey
edubeyAccepted solution
New Participant
January 14, 2016

Write a OSGI service to do this sorting.

There is one more approach you can try for:

Add a beforesubmit listener in your dialog box and before data gets saved in JCR, sort it with JS

ranadyutis95334
New Participant
January 14, 2016

Hi,

I am using JSP

edubey
New Participant
January 14, 2016

To me looks like default AEM behavior, I would recommend to write simple n small piece of java code to sort these manually.

You are using JSP or Sightly?

ranadyutis95334
New Participant
January 14, 2016

Here is the sorted tags appearing

ranadyutis95334
New Participant
January 14, 2016

Hi,

Thanks for your reply. You see the tags are sorted while applying. But they are not appearing in order in the page. Attached is the screenshot