Hi All,
I have requirement to display the dynamic number of child page in one component.
Example: parent page -> 4 child page should be sorted on the basis we can assign number
Page1,page2,page3 and page4
Now I have created one title component with page number and that page number need to display
Solved! Go to Solution.
Views
Replies
Total Likes
Don't use a query for this case, it's definitely easier to collect the direct (!) child pages via the API; a query will consider the complete subtree by default, that could even be grand-children.
There are several ways to handle this, a few are
[1] https://www.javatpoint.com/Comparator-interface-in-collection-framework
Use indexing to sort page with its number. Add page number of the child pages as sortable indexed property in oak:index. Use a query with a sort parameter as the page number to list the child pages.
you can simply use query to get sorted results
type=cq:Page path=/content/we-retail/us/en orderby.sort=desc orderby=@jcr:content/pageIndexNumber p.limit=-1
Don't use a query for this case, it's definitely easier to collect the direct (!) child pages via the API; a query will consider the complete subtree by default, that could even be grand-children.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies