Update references via Content Migration script
Use a migration script to update all references from one document to another
Go to Update references via Content Migration scriptBrowse ready-made Sanity.io schemas to structure your content quickly. Find useful code snippets for workflows, input components, migration scripts, and studio configurations.
Use a migration script to update all references from one document to another
Go to Update references via Content Migration scriptAlternative solution to Webhook revalidation
Go to Next.js on-demand Tag Revalidation with Custom Document ActionsThis validation can be used if you have an object with two fields and you require one or the other to be filled
Go to Object level One or the Other validationUse modules to build your pages? Want to grab a link to a specific module? This schema is just for you!
Go to Adding Jump Links to Page ModulesThis Input component is used for removing e.g the Duplicate action for items in a list
Go to Remove Array item's actions from the context menuthis blog for beginner how to make blog in sanity with next js
Go to Next.JS blog use sanitySimplify your Studio experience by hiding deprecated fields when you create new documents.
Go to Hide a deprecated field in new documents🚫 MyFile / ✅ MyFile.pdf
Go to Add extensions to asset original filenamesThis snippet is useful if you want a desk structure that allows columns with a parent page and children pages underneath it. As deep as you would like.
Go to Unlimited nestingLearn how to build a custom image gallery preview component that can be added to Portable Text.
Go to Custom Image Gallery Preview Component - Portable TextIf you're working on integrating portable text with custom markDefs using groqd, the following code snippet could be very useful. It might save you a considerable amount of research time.
Go to groqd implementation with portable text custom marksVariant Generator for Products with Options
Go to Variant Generator Custom Input Component for Products with OptionsOpen editor and preview pane in split view all the time
Go to Open editor and preview pane in split view all the timeInsert related components next to a native one
Go to Helper function to add custom components above or below a native one.A code snippet to create a custom '+ Add item' button to add items to the top of an array.
Go to Add items to top of array with custom '+ Add item' buttonWanna use Sanity to build a PageBuilder? Show previews of your blocks/sections!
Go to Custom PageBuilder Input Component - Preview Blocks & SectionsCode examples using document.newDocumentOptions to hide the Create new document button at the structure level and/or disable it in the global create menu.
Go to Disable new document creation button at structure and global level with document.newDocumentOptionsA dynamic group filled with fields that don't have any defined group.
Go to Create a dynamic 'Unmapped fields' group in your document definition