List Order By published or lastReplicated date | Community
Skip to main content
Level 3
Sep 15, 2022 9:58 PM UTC
Solved

List Order By published or lastReplicated date

I have a component which extends from List component. Currently we only have option to Order By title or Last Modified date but we want the list to be Order by published or lastReplicated date. What will be best approach to do this? I was thinking to pull the list in component.js file and create a method to sort the list but wanted to see if AEM offer an easier solution to solve this issue and if any see issue with this solution. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
SantoshSai
SantoshSaiAccepted solution
New Participant
Sep 16, 2022 4:15 PM UTC

@moiezma - If it's already implemented you can use it, otherwise I would go with server side implementation.

Santosh Sai

3 replies

SantoshSai
New Participant
Sep 15, 2022 11:49 PM UTC

Hi @moiezma ,

If your custom component have sling model/services implemented you may add the logic in existing services which will be responsible to fetch published or lastReplicated date. 

The best approach I can consider is to delegate "com.adobe.cq.wcm.core.components.models.List" and have business logic to it.

Hope that helps!

Regards,

Santosh

Translate
Santosh Sai
MoiezMaAuthor
Level 3
Sep 16, 2022 3:42 PM UTC

Thank you @santoshsai We have javascript file in component with use-api. I guess we can use that to write logic. 

Translate
SantoshSai
SantoshSaiAccepted solution
New Participant
Sep 16, 2022 4:15 PM UTC

@moiezma - If it's already implemented you can use it, otherwise I would go with server side implementation.

Translate
Santosh Sai