static icon indicating copy to clipboard operation
static copied to clipboard

Reverse ordering of collections

Open arunvickram opened this issue 1 year ago • 1 comments

Hi!

I was wondering whether it was possible to reverse the order of a collection? I'm trying to show blog posts from latest to oldest but for some reason I'm not able to do it. Any help is appreciated.

Thanks!

arunvickram avatar Feb 09 '24 16:02 arunvickram

Hey @arunvickram, yep. You should be able to pass that like so:

<ForEach content="post" as="post" orderBy="date,desc" count="{count}">
    ...
</ForEach>

This will order by date in desc order. Or you could specify asc to ascending order. Let me know if that helps :)

Thanks!

tnylea avatar Feb 27 '24 14:02 tnylea