Sanity: Make hidden property work on document type

Created on 11 Jun 2018  路  7Comments  路  Source: sanity-io/sanity

Applying the hidden: true property on a schema type should make it invisible in the desk-tool. It currently doesn't.

{
  title: 'Thing',
  name: 'thing
  type: 'document',
  hidden: true
  fields: [...]
}
Bug

Most helpful comment

Ah, I see!
If you don't need to create standalone documents from the type, it should probably be of type object instead. That'll hide it from the sidebar too. More details of the differences between object and document here: https://www.sanity.io/docs/document-type

All 7 comments

This can now be neatly solved with the Structure builder. Closing this issue.

Does this mean the hidden prop will be removed as a field on schemas?

@runeh No, the hidden prop will still be available on fields.

It will be there and not work? Or did this actually get fixed?

Nothing has changed :) Fields still have the hidden-option which will hide them from the editor UI. This issue was originally about supporting hidden on a document type, e.g.:

{
  type: 'document',
  hidden: true,
  fields: [...]
}

Which we figured doesn't really make much sense. Hidden from what/where? - if you make it to mean hidden from the UI, we believe that would now better achieved using structure.

Hope that clarifies!

What I wanted to do, before structure, was to hide a document type from the sidebar in studio. It should ONLY be possible to create a document of type as a child of another document type. If I can do that easily with structure, that's probably fine.

Ah, I see!
If you don't need to create standalone documents from the type, it should probably be of type object instead. That'll hide it from the sidebar too. More details of the differences between object and document here: https://www.sanity.io/docs/document-type

Was this page helpful?
0 / 5 - 0 ratings