Docs

v.Latest
Introduction
Core Concepts
Querying Content
Editing
Customizing Tina
Going To Production
Media
Drafts
Guides
Further Reference

In most cases, just using fields is enough, however templates can be used when there are multiple variants of the same collection or object. For example in a "page" collection there might be a need for a marketing page template and a content page template, both under the collection "page".

Definition

PropertyDescription
nameThe name of the template
labelA human friendly label that will be displayed to the user
inlineChanges the component to inline styling
fieldsAn array of fields

Example using templates instead of fields

export default defineConfig({
//...
schema: {
collections: [
{
name: 'page',
label: 'A page of the website',
path: 'content/pages',
format: 'mdx',
templates: [
{
name: 'content',
label: 'Content Page',
fields: [
// ... content page fields
],
},
{
name: 'marketing',
label: 'Marketing Page',
inline: true,
fields: [
//... marketing page fields
],
},
],
},
],
},
})
Last Edited: June 15, 2022