Discussion about reordering posts in Sanity admin panel
39 replies
Last updated: May 20, 2021
M
Hello all, I have whats potentially a dumb question but a client has asked if there is a way for them to easily reorder their posts in the admin panel of Sanity.
They are thinking of the ability to drag and drop items in section like the screenshot attached to whatever order they want, so dragging the post at the bottom to be the one at the top, so an easy to use sort order feature.
Was just wondering what the easiest way of doing this for them might be?
Thanks as always!
They are thinking of the ability to drag and drop items in section like the screenshot attached to whatever order they want, so dragging the post at the bottom to be the one at the top, so an easy to use sort order feature.
Was just wondering what the easiest way of doing this for them might be?
Thanks as always!
May 20, 2021, 8:18 PM
J
My guess is, probably not something easily achieved.. maybe they would be happy with sorting by a different property?
May 20, 2021, 8:41 PM
M
user M
- you mean make an array of references or something like that?May 20, 2021, 8:44 PM
J
I mean, first you could just either sort by something like creation time, or last modified time.. one of those might give a pleasing order
May 20, 2021, 8:45 PM
J
and if that's really not enough, maybe something as simple as an "importance" field?
May 20, 2021, 8:46 PM
J
to add some more control over relative sorting
May 20, 2021, 8:46 PM
J
I guess it depends on why they want to see things in a certain order
May 20, 2021, 8:47 PM
J
maybe what they actually want is to have some groupings of posts.. and controlling the order to them seems like an easier way of doing that
May 20, 2021, 8:48 PM
M
They just want to chop and change the order of posts and other repeated elements in a simple GUI way - simple as that really.
May 20, 2021, 8:48 PM
J
do they want that to then be reflected in on the website?
May 20, 2021, 8:48 PM
M
Exactly that.
May 20, 2021, 8:48 PM
J
sorry, I was wrongly assuming this was just about how things looked in the studio..
May 20, 2021, 8:49 PM
M
So, another section has projects the client has created and they would want to change the order every now and then.
May 20, 2021, 8:49 PM
J
one idea, if it's not important to have EVERYTHING sorted.. have a document with an array of references to projects that is the "highlight" projects
May 20, 2021, 8:51 PM
J
anything not referenced there comes afterwards
May 20, 2021, 8:51 PM
J
I'm pretty sure sanity has some kind of a widget that lets you drag and drop an array of references
May 20, 2021, 8:51 PM
M
user M
- I was thinking along those lines too, just wanted to make sure I wasn't missing something obvious!May 20, 2021, 8:52 PM
J
I'm new to sanity, but my instinct would be that that is the way to go
May 20, 2021, 8:52 PM
J
I'm pretty sure sanity has some kind of a widget that lets you drag and drop an array of references
May 20, 2021, 8:51 PM
J
I'm new to sanity, but my instinct would be that that is the way to go
May 20, 2021, 8:52 PM
J
I guess it depends on why they want to see things in a certain order
May 20, 2021, 8:47 PM
M
Cheers
user M
- appreciate your thoughts!May 20, 2021, 8:53 PM
M
user M
- I was thinking along those lines too, just wanted to make sure I wasn't missing something obvious!May 20, 2021, 8:52 PM
J
maybe what they actually want is to have some groupings of posts.. and controlling the order to them seems like an easier way of doing that
May 20, 2021, 8:48 PM
M
They just want to chop and change the order of posts and other repeated elements in a simple GUI way - simple as that really.
May 20, 2021, 8:48 PM
J
hold on a minute, looks like exactly what they want DOES exist..
May 20, 2021, 8:54 PM
J
do they want that to then be reflected in on the website?
May 20, 2021, 8:48 PM
J
May 20, 2021, 8:54 PM
M
Exactly that.
May 20, 2021, 8:48 PM
J
sorry, I was wrongly assuming this was just about how things looked in the studio..
May 20, 2021, 8:49 PM
M
So, another section has projects the client has created and they would want to change the order every now and then.
May 20, 2021, 8:49 PM
M
user M
Well, would you look at that... This is why I like to ask on here. Thanks so much! Will have a delve into that.http://gph.is/14bAT3a
May 20, 2021, 8:57 PM
J
one idea, if it's not important to have EVERYTHING sorted.. have a document with an array of references to projects that is the "highlight" projects
May 20, 2021, 8:51 PM
J
anything not referenced there comes afterwards
May 20, 2021, 8:51 PM
J
I'm pretty sure sanity has some kind of a widget that lets you drag and drop an array of references
May 20, 2021, 8:51 PM
J
probably still worth keeping in mind that this is likely to stop being very usable when the number of documents gets to a certain point
May 20, 2021, 9:00 PM
J
finding any individual document will be hard, and you'll need to do a lot of dragging to move around
May 20, 2021, 9:00 PM
J
if you're ordering and selecting a limited number of documents in a "highlighted documents" reference array, you'll be able to search for specific documents
May 20, 2021, 9:01 PM
M
Oh for sure, the instance they need it for is relatively limited. I’ll get into the weeds with it but I just wanted to test the water of what there was before I did.
Thanks again, appreciate your time.
Thanks again, appreciate your time.
May 20, 2021, 9:09 PM
J
no worries, good luck, customer's always wrong 😉
May 20, 2021, 9:09 PM
Sanity– build remarkable experiences at scale
Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.