Skip to content

Remove "Media Tag" from Create New Document menu? #43

Answered by robinpyon
joaodotwork asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @joaodotwork – you can configure the new document menu using Sanity's structure builder. Link to documentation

Simply add the following to the parts array in your sanity.json:

{
  "parts": [
    {
      "name": "part:@sanity/base/new-document-structure",
      "path": "./newDocumentStructure.js"
    }
  ]
}

And in ./newDocumentStructure.js

import S from '@sanity/base/structure-builder'

export default [
  // Bring in default values
  ...S.defaultInitialValueTemplateItems()
    // Filter out document types of `media.tag`
    .filter(template => {
      if (template.spec.id === 'media.tag') {
        return false
      }
      return true
    })
]

Hope that helps!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@joaodotwork
Comment options

Answer selected by joaodotwork
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants