Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Programmatically arranging contents in aem 6.4

Avatar

Level 2

Hello everyone. I'm new in working with aem. I'm using aem 6.4. My task is to programmatically sort the order of the contents of a cq:project in aem depending on the content of a json file. The content of the json file should be set as the initial child instead of the children sorted by their creation date.

This is the current structure of my cq:page. If the child2 is the one indicated in the json file, it should be the first one to be displayed. The content of the json file is just the name of one child so even though there are 10 children, the content of the json file should always be the first one in the list.

1714724_pastedImage_0.png

I've spent hours researching on how I can implement this although I still can't find any solution. Any insights on how should I create this? Thanks!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
2 Replies

Avatar

Level 10

Typically Pages are ordered under content based on how the site is setup in site admin. You can work with pages via the PageManager API - PageManager ("The Adobe AEM Quickstart and Web Application.")

Avatar

Correct answer by
Community Advisor

Hi,

you can try to order child node using Node API

JCR 2.0: 23 Orderable Child Nodes (Content Repository for Java Technology API v2.0)



Arun Patidar