adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
733 stars 740 forks source link

Content Fragment List Order by 'Created' different in author and publish #1342

Open biddana2 opened 3 years ago

biddana2 commented 3 years ago

Bug Report

Current Behavior When using a Content Fragment List, and ordering by 'Created', shows the correct order in Author instance. But on Publish instance, it shows the order in which the CFs were published, not when they were created on author.

Expected behavior/code The order of CFs in the CF List should be the same in Author and Publish instances.

Author: image

Publish: image

CF List Ordered by 'Created' image

The workaround for this is to unpublish the CFs under the path, and publish them in the order you want them to show. But the CF List order by 'created' should use the 'created' date from author.

Expected behavior/code The order of CFs in the CF List should be the same in Author and Publish instances.

Environment

Additional context / Screenshots This can be re-created on a vanilla instance.

biddana2 commented 3 years ago

Hi @richardhand @vladbailescu, do we wait for someone to pick these up?

msagolj commented 3 years ago

hi @biddana2, theOrder By field Created is based on when the CF is created as you said, so the date gets 'reset' once the CF's get published and recreated on the publish instance. So a better naming would maybe be 'published Date'.

What you are looking for is date that is stored as part of your CF. So you would have to add a date field to your content fragment model and sort by that one. Unfortunately the current implementation only allows for ordering by string fields.

There has been a feature request for this see #1078, which also describes a workaround to be able to sort by date.