Programmatically arranging contents in aem 6.4 | Community
Skip to main content
rockie-rocafort
Level 2
March 19, 2019
Solved

Programmatically arranging contents in aem 6.4

  • March 19, 2019
  • 2 replies
  • 1890 views

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.

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!

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 arunpatidar

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)

2 replies

smacdonald2008
Level 10
March 19, 2019

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.")

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
March 19, 2019
Arun Patidar