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