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".
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 |
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
Product
Resources
© TinaCMS 2019–2024