Structured Content 2022: Join our conference to explore fresh perspectives on content and digital experiences →

I want to add a view with the Structure builder (S.view.component) where I list similar documents based on the title. What would be the best way to use GROQ there?

7 replies
Last updated: Sep 23, 2020

Hi! I want to add a view with the Structure builder (

S.view.component
) where I list similar documents based on the title. What would be the best way to use GROQ there? Should I use the
documentStore
, or is there an easier way?

Sep 23, 2020, 12:32 PM

You could use the approach we're using here to show “incoming comments/references”. QueryContainer is also realtime I believe https://github.com/sanity-io/sanity-template-website-studio/blob/c296116316b1d9d65f99ac56b93cdf5679652f5b/template/studio/src/components/CommentList.js

Sep 23, 2020, 12:39 PM

perfect, exactly what I was looking for

Sep 23, 2020, 12:40 PM

You could use the approach we're using here to show “incoming comments/references”. QueryContainer is also realtime I believe https://github.com/sanity-io/sanity-template-website-studio/blob/c296116316b1d9d65f99ac56b93cdf5679652f5b/template/studio/src/components/CommentList.js

Sep 23, 2020, 12:39 PM

perfect, exactly what I was looking for

Sep 23, 2020, 12:40 PM

schemathon already paying off! 👌

Sep 23, 2020, 1:31 PM

Sanity.io: Get the most out of your content

Sanity.io is a platform to build websites and applications. It comes with great APIs that let you treat content like data. Give your team exactly what they need to edit and publish their content with the customizable Sanity Studio. Get real-time collaboration out of the box. Sanity.io comes with a hosted datastore for JSON documents, query languages like GROQ and GraphQL, CDNs, on-demand asset transformations, presentation agnostic rich text, plugins, and much more.

Don't compromise on developer experience. Join thousands of developers and trusted companies and power your content with Sanity.io. Free to get started, pay-as-you-go on all plans.