✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

How to bring back the missing filter order in the document pane in Sanity.io

8 replies
Last updated: Aug 3, 2021
Hi all. I've built a bespoke structure builder and the ordering at the top of the pane (the three dots to be able to filter) has gone but only comes back if I use S.documentTypeListItems() and I tried to find a way of bringing it back. So now I'm trying to create a new list item to filter using GROQ for example 'client by name' etc but I don't know how to query a document list or even where. Do I add something in the filter method for example by name ascending or descending as well as the date? I'm really stuck and help would be appreciated.
Aug 2, 2021, 7:40 PM
This is the missing filter order I mentioned from the document pane.
Aug 2, 2021, 7:43 PM
Hey User! What does your
look like?
Aug 2, 2021, 9:06 PM
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')
                .title('Create Project')
                    .filter('_type == "project"')
                  .title('Client Footer')
       // ...S.documentTypeListItems() not using 

Aug 2, 2021, 9:14 PM
I'm assuming it might have to do with adding a method regarding the three dots. Thanks
Aug 2, 2021, 9:18 PM
I see! A
can take a
and a
method . Adding one of those might be the solution! If that doesn’t work, you could try converting it into a
instead as that will include ordering by default.
Aug 2, 2021, 10:07 PM
Ah, thanks so much! I will check this out.
Aug 3, 2021, 8:39 AM
                    .filter('_type == "project"')
    S.orderingMenuItem({title: 'Project Title ascending', by: [{field: 'theFieldName', direction: 'asc'}]}),
    S.orderingMenuItem({title: 'Project Title descending', by: [{field: 'theFieldName', direction: 'desc'}]})
Aug 3, 2021, 2:39 PM
If anyone else is wondering how to solve this I used the menuItem([...]) as you can see above. You can also swap out the ordering in the MenuItems([...]) for the normal document ordering property.
Aug 3, 2021, 2:42 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.

Was this answer helpful?