Schemas and snippets
PHP Sanity: a collection of convenience functions for Sanity's official PHP API
PHP Sanity is a collection of convenience functions for use with the official Sanity PHP API. https://github.com/chrispecoraro/PHP-Sanity
Go to PHP Sanity: a collection of convenience functions for Sanity's official PHP APIGROQ query to find all the different categeries of products
Display random document in the studio desk
Use an asynchronous list item in the structure builder to display a random document
Go to Display random document in the studio deskAuto-reload Studio when changes are deployed
Drop this into your Studio to let editors know when there's a more recent version of your Studio available, making sure they have the latest fields and validations.
Go to Auto-reload Studio when changes are deployedEvent directory schemas
Schemas for creating an event directory on Sanity
Go to Event directory schemasSet slug on publish with referenced field value - has 5 likes
Set slug on publish document action
Go to Set slug on publish with referenced field valueGROQ query to find duplicate data
GROQ query that finds duplicate data in a given field.
Go to GROQ query to find duplicate dataGROQ query to pull data for image palette information
A query to pull the rich color data associated with an image from the Sanity Asset Pipeline
Go to GROQ query to pull data for image palette informationBreaks for Portable Text
How to add different types of “breaks” for Portable Text that can be translated to horizontal rules, “read more”, sections, chapters, and so on.
Go to Breaks for Portable TextFile Searchable Select
Choose a file from a searchable select
Go to File Searchable SelectHow to list and group image asset documents
Add lists of image assets based on information in the asset document using the Structure Builder API
Go to How to list and group image asset documentsuseCurrentUser Custom React Hook
Get details of the currently logged in Sanity user
Go to useCurrentUser Custom React HookRename a field across documents
Migration script for renaming a field based on a GROQ query
Go to Rename a field across documentsNormalize Portable Text blocks
Migration script to normalize Portable Text blocks across your whole dataset
Go to Normalize Portable Text blocksMigration script for document types
This migration scripts lets you migrate documents to a new type.
Go to Migration script for document typesInitial value template with current user
Use data for the current logged in user as initial values in a new document
Go to Initial value template with current userPopulate fields with data from a file upload
Do something with a uploaded file and populate a field in the document based on that
Go to Populate fields with data from a file upload