Loving Tina? ⭐️ us on GitHubStar

We use cookies to improve your experience. By continuing, you agree to our use of cookies. Learn More

Docs

Learn

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

Property

Description

name

The name of the template

label

A human friendly label that will be displayed to the user

inline

Changes the component to inline styling

fields

An 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