Simeon Griggs
🇦🇺 in 🇬🇧 Solution Engineer @ Sanity
Display the results of any GROQ Query inside a View Pane
Displays the results of a GROQ query in a View Pane. With the ability to use field values in the current document as query parameters.
sanity install documents-pane
This plugin is designed to be used as a Component inside of a View.
The example below illustrates using the current Document being used to query for all Documents that reference it.
// ./src/deskStructure.js
import DocumentsPane from 'sanity-plugin-documents-pane'
// ...all other list items
S.view
.component(DocumentsPane)
.options({
query: `*[!(_id in path("drafts.**")) && references($id)]`,
params: {id: `_id`},
useDraft: false,
debug: true,
})
.title('Incoming References')
The .options()
configuration works as follows:
query
(string, required)params
(object, optional) A dot-notated string from the document object to a field, to use as variables in the query.useDraft
(bool, optional, default: false
) When populating the params
values, it will use the published
version of the document by default.debug
(bool, optional, default: false
) In case of an error or the query returning no documents, setting to true
will display the query and params that were used.This plugin is based on Incoming References originally written by Victoria Bergquist.
MIT © Simeon Griggs See LICENSE
sanity install documents-pane
🇦🇺 in 🇬🇧 Solution Engineer @ Sanity
Cats & Plants 💚
Drag-and-drop Document Ordering without leaving the Editing surface
Go to Orderable Document ListSchedule and view your editorial calendar, right where you store your content. Prioritize and get organized on the fly with a visual calendar in your Studio.
Go to Content CalendarUpload videos to Mux directly from the studio.
Go to Mux inputPlugin for authoring multiple language versions of a complete document
Go to Document Internationalization