Need to sort tags alphabetically. | Community
Skip to main content
ranadyutis95334
Level 3
Jan 14, 2016 8:35 AM UTC
Solved

Need to sort tags alphabetically.

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.
edubey
edubeyAccepted solution
Level 10
Jan 14, 2016 12:13 PM UTC

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
Feb 5, 2018 2:24 PM UTC

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)

Translate
harsha006
New Participant
Feb 5, 2018 10:53 AM UTC

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.

Translate
New Participant
Jan 2, 2018 4:20 PM UTC

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

Translate
New Participant
Nov 3, 2017 5:51 AM UTC

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

Translate
New Participant
Oct 27, 2017 7:24 AM UTC

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.

Translate
edubey
edubeyAccepted solution
Level 10
Jan 14, 2016 12:13 PM UTC

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

Translate
ranadyutis95334
Level 3
Jan 14, 2016 12:04 PM UTC

Hi,

I am using JSP

Translate
edubey
Level 10
Jan 14, 2016 11:43 AM UTC

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?

Translate
ranadyutis95334
Level 3
Jan 14, 2016 11:19 AM UTC

Here is the sorted tags appearing

Translate
ranadyutis95334
Level 3
Jan 14, 2016 11:18 AM UTC

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

Translate