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

[4.x] Remove requirement of orderable collection from next/prev tags #8810

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

jasonvarga
Copy link
Member

At the moment, the collection:next/prev tags only work on dated or orderable collections. "Orderable" collections are ones with a structure set to max depth of 1.

This was because the "order" was ambiguous for multi-depth collections. A while ago in #4883 we made the decision for it to just assume the order is depth-first (how it looks if you read down the page while looking at the tree).

We never looped back and added support for that within the collection:next/prev tags.

This PR removes that requirement. If you want to sort by order, go for it. You can technically even sort a dated collection by order if you add an order field to each entry.

The default sort order of a multi-depth structured collection is title. Since we don't want to make it a breaking change, to get these tags to work, you'll need to add sort="order". In Statamic 5 we will change the default sort order of a multi-depth structured collection to order.

@jasonvarga jasonvarga merged commit 6b236c7 into 4.x Oct 5, 2023
32 checks passed
@jasonvarga jasonvarga deleted the collection-next-prev-structured branch October 5, 2023 15:41
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

Successfully merging this pull request may close these issues.

1 participant