🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup

How to remove the "Create New Document" action from a specific part of the document list structure.

3 replies
Last updated: May 10, 2024
Anybody know how to remove the "Create New Document" action (the + icon) from a document list. I've got a structure like this: Programs > By Department > Departments > Programs. I'm not sure I want editors to being to create Departments or Programs from this particular part of the desk structure, but I do want them to be able to create new documents from the main "Create" new document button in the Studio and also if they're under the main Department and/or Programs list, but not from these filtered lists. I'm also not sure that content editors wouldn't want to be able to create new documents in this context, but I'm curious nonetheless. Thanks.
May 10, 2024, 3:05 PM
Maybe I'm using the wrong structure builder list item because I just noticed that the Programs list on the far left has chevron icons to the right indicating a sublist, whereas the departments list is lacking those chevron icons suggesting it opens a document, but surprise surprise it opens another list of programs. Hmm...
May 10, 2024, 3:10 PM
And in that case, I'd actually prefer the + icon remain on the filtered programs list so that they can create new programs that are automatically populated with the department they're currently under
May 10, 2024, 3:12 PM
In case anyone cares, I was able to modify the code from here to achieve what I was after: https://www.sanity.io/guides/parent-child-taxonomy#91b8b58d75d4?search=structure%20posts%20by%20category
May 10, 2024, 4:21 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?