Deep Structure Integration and Helpers
Use site/language-aware structure helpers to build cleaner Sanity desk structures with consistent filters, intents, and template wiring.
Overview
This feature focuses on reusable helper APIs for Sanity Structure Builder, so teams can add document panes without rewriting site/language logic each time.
Primary helper implementation is in:
apps/sanity/structure/helpers/languageSiteStructure.tsapps/sanity/structure/helpers/filters.tsapps/sanity/structure/helpers/initialValueTemplates.ts
What the helpers provide
Drop-in list item replacements
makeLanguageSiteHelpers(...) returns:
siteDocListItem(...)for types withsiteonlylanguageSiteDocListItem(...)for types with bothsiteandlanguage
These act as wrappers around S.documentTypeListItem(...), but include:
- consistent GROQ filters
- intent handling (
canHandleIntent(...)) - default ordering hooks
- correct initial value templates
Shared filter primitives
structureFilters(...) defines canonical filter fragments:
SITE_FILTERLANGUAGE_SITE_FILTER
This prevents drift where different sections accidentally query different scoping conditions.
Template binding at pane level
structureInitialValueTemplates(...) generates static and dynamic template items for use in structure panes, keeping “new document” actions aligned with the current site/language context.
Why this matters at scale
Without helpers, each structure section must manually manage filters, templates, and intent behaviour. That creates duplication and increases the risk of inconsistent editorial outcomes.
With these helpers, adding a new site-aware content type is usually one helper call plus optional ordering/filter overrides.
Typical extension workflow
- Add
defineSiteField()and optionallydefineLanguageField()in schema. - In structure, choose
siteDocListItem(...)orlanguageSiteDocListItem(...). - Add ordering or extra templates only where needed.
This keeps customisation local while preserving global multisite conventions.
Last updated: 27 Apr 2026, 14:59:48
