We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Unable to order entries based on the order the slugs are received.
return [ 'endpoints' => [ 'entries.json' => function() { $slugs = Craft::$app->getRequest()->getRequiredQueryParam('slugs'); return [ 'elementType' => Entry::class, 'criteria' => [ 'slug' => $slugs ], 'transformer' => function (Entry $entry) { return [ "title" => $entry->title, ]; }, ]; } ] ]
The text was updated successfully, but these errors were encountered:
Hi, thanks for reaching out! This is expected behaviour.
By default, entries are ordered by postDate DESC, elements.id DESC. For your entries endpoint, you can provide your own order via criteria > orderBy.
postDate DESC, elements.id DESC
criteria
orderBy
There’s also the fixedOrder option, which might be helpful if you’re querying by ids: https://craftcms.com/docs/4.x/entries.html#fixedorder.
fixedOrder
I hope this helps!
Sorry, something went wrong.
No branches or pull requests
Description
Unable to order entries based on the order the slugs are received.
Steps to reproduce
Additional info
The text was updated successfully, but these errors were encountered: