Initial-value templates
Give “create new” a head start: a page pre-composed with the sections a landing page needs, or an article pre-filed in a category.
A blank document with an empty page builder is the least helpful thing a Studio can show an editor. Templates fix that.
export const templates = [
{
id: 'page-landing',
title: 'Landing page (hero → features → call to action)',
schemaType: 'page',
value: {
sections: [
{ _type: 'heroSection', _key: 'hero', layout: 'centered' },
{ _type: 'featureGridSection', _key: 'features', columns: '3' },
{ _type: 'ctaSection', _key: 'cta', tone: 'accent' },
],
},
},
]A template may take parameters, which is how a "new article in this category" action can pre-fill the reference:
{
id: 'doc-article-in-category',
schemaType: 'docArticle',
parameters: [{ name: 'categoryId', type: 'string' }],
value: (params) => ({ category: { _type: 'reference', _ref: params.categoryId } }),
}The one rule
Pre-fill structure, not words. A template that ships placeholder copy is a template whose placeholder copy eventually ships to production. Sections without text are a head start; sections with "Lorem ipsum" are a liability.
