I have a set of documents and I want editors to be able to choose the order they appear. I haven't been able to find any information about this. Is there a standard or built-in way to handle this in Sanity, or a plugin?
I could add a sortOrder
field to the document but editors would have to fill in numbers. Inserting a document early in the list would mean manually incrementing each document after it.
I've tried creating a singleton document with a field that has type: 'array', of: [{ type: 'reference', to: [{ type: 'myType' }] }]
. This does work but it seems like a workaround and doesn't make for a good editor experience. You have to create a new doc then go to this singleton doc and add it there too. It also seems to query more slowly.
Any advice? Is there already a nice way to do this that I missed?