Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse ordering of collections #13

Open
arunvickram opened this issue Feb 9, 2024 · 1 comment
Open

Reverse ordering of collections #13

arunvickram opened this issue Feb 9, 2024 · 1 comment

Comments

@arunvickram
Copy link

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!

@tnylea
Copy link
Contributor

tnylea commented Feb 27, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants