How to bring back the missing filter order in the document pane in Sanity.io
import S from "@sanity/desk-tool/structure-builder";
import { createSuperPane } from 'sanity-super-pane';
//import {FiSettings } from "react-icons/fi";
export default () => S.list()
.title('Cube Content')
.items(
[
S.listItem()
.title('Clients')
.child(
S.list()
.title('Clients')
.items([
S.listItem()
.title('Create Project')
.child(
S.documentList()
.title('project')
.schemaType('project')
.filter('_type == "project"')
),
S.listItem()
.title('Client Footer')
.child(
S.document()
.schemaType('clientFooter')
.documentId('clientFooter')
),
])
),
// ...S.documentTypeListItems() not using
],
)documentListcan take a
defaultOrderingand a
getDefaultOrderingmethod . Adding one of those might be the solution! If that doesn’t work, you could try converting it into a
documentTypeListinstead as that will include ordering by default.
.child(
S.documentList()
.title('Projects')
.schemaType('project')
.filter('_type == "project"')
.menuItems([
...S.documentTypeList('project').getMenuItems(),
S.orderingMenuItem({title: 'Project Title ascending', by: [{field: 'theFieldName', direction: 'asc'}]}),
S.orderingMenuItem({title: 'Project Title descending', by: [{field: 'theFieldName', direction: 'desc'}]})
])
),
]), Was this answer helpful?
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.