-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
sortableFields should have default sorting options #3715
Comments
Thanks @fbnlsr, the sorting order and key should be persisted per collection, so you should only need to do it once (if that is not the case, can you please update to latest version and test again?). The reason we didn't enabled a default sort is that it would require fetching all entries on initial load which can take some time (in large collections one might even reach the APIs limits). Allowing to opt-in to it makes sense though. The grid view not persisting is another issue unrelated to sorting. |
You're right, order and key are persisted. Grid view is not. If we could still be able to enforce it via |
Just to make it clear - if a user manually sorts, that would override the config sort right? |
I feel it makes sense yes. The config could be used as a starting point or as an order suggestion, but it shouldn't come at the experience of the user's experience. That is unless we could "freeze" it and make it impossible for the user to sort it again once it's been set in the config. We could imagine another optional key in the config that would make it so the sorting would be impossible. In that case, the sortableFields:
display: "grid"
key: "commit_date"
type: "desc"
allow_sorting: false
fields:
- "commit_date"
- "author"
- "title" |
I would like to work on this issue 😄 |
For those who are wondering without official thing. You can find a localstorage entry called netlify-cms.entries.sort you can create this entry on local storage if there is none. With desired sorting. So when user logs in if there is none it will default to yours. |
Was this implemented, or why the closure? |
This was not implemented, @fbnlsr is there a reason why you closed the issue? |
Sorry I was doing some housekeeping on my GitHub and thought it was resolved. I'm reopening the issue. |
Is your feature request related to a problem? Please describe.
Whenever I log into Netlify CMS, I have to always do the same operation so that the entries of a folder collection is displayed the way I'd like.
Describe the solution you'd like
I'd like if we could have an option in the
sortableFields
config so that we could specify a default order and display type. So for instance we could specify something like:The text was updated successfully, but these errors were encountered: