How to Add Preview (Analyse) To A Singleton Document

1 replies
Last updated: May 18, 2021
I’m trying to add preview (a view) to a singleton document. It works fine for all other documents, but the singleton does not seem to work same way.
May 18, 2021, 2:43 PM
I figured it out. Inside of my singleton I have a
S.document()
, that can get views.
S.listItem()
        .title("FAQ")
        .icon(MdQuestionAnswer)
        .child(
          S.document()
            .schemaType("faq")
            .documentId("faq")
            .views([
              S.view.form(),
              S.view.component(NoProjectPagePreview).title("Norwegian Page"),
            ])
        ),
May 18, 2021, 2:50 PM

Sanity.io – build remarkable experiences at scale

Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Categorized in