Replies: 1 comment 1 reply
-
See my answer here for the full background, sorting is very similar to filtering: #357 (comment) There are two parts to this, I'll answer them separately What you can do nowYou can't specifically sort entries (what you call items, we call entries) in a collection in Keystatic, they're ordered by the slug. You can generate the slug in the way you want the entries ordered, e.g by putting a timestamp at the start, etc. I've also seen people add an To sort entries when you read them with the Reader API, just use JavaScript, e.g if you wanted them sorted by date (and have a date field in the entry schema):
(array sort docs here) What we have plannedLike I mention in #357 and #375 we do plan to add columns to the Admin UI, and make entries sortable, which will improve usability a lot in this case. We're also exploring adding drag and drop functionality to the collection view to make it easier to reorder entries (e.g if you're using an I expect the Reader API will stay as it is, because we'd prefer not to prescribe what you can do with it, and encourage just using JavaScript instead (like in the example above, you could use |
Beta Was this translation helpful? Give feedback.
-
Is there a way to sort items in a collections? Either inside the keystatic-Admin Panel or by the
Reader API
?Beta Was this translation helpful? Give feedback.
All reactions