Media Library

Aspect patterns

Common patterns for defining aspects

In the Create an aspect guide you learned to define and deploy an aspect. This guide explores common patterns for defining aspects.

Prerequisites:

  • sanity CLI v3.88.0 or newer.

Single string field

Single boolean field

Multiple fields

Global references

You can combine aspects with global document references. Use the globalDocumentReference type to target documents in another project and dataset. This example targets a photographer type in the example dataset of the 3do82whm project.

The resourceId value is the projectId.datasetName. As with normal references in Studio, you can use the preview property to select fields to display. In this case, it sets the preview title to the photographer.name field.

Learn more about Global Document References.

Was this page helpful?