Front Matter Templates

Table of Contents
- [Options](#options)

Within your .tina folder, there is a folder labeled front_matter/templates. This folder houses all of your content models for your site.

These front matter templates work by allowing developers to define which fields are associated with a content type. These definitions can then be used to query for data and display data. You can edit pre-existing template files as well as create your own YAML files.

The following is an example of a front matter template configuration file.

homepage.yml
---
pages:
  - index.md
hide_body: false
fields:
  - name: title
    default: ''
    label: Title
    hidden: false
    type: text
  - name: publishDate
    default: ''
    label: Date
    hidden: false
    type: datetime
  - name: Categories
    default: []
    label: Categories
    hidden: false
    type: list
---

Templates define the shape of certain content models (e.g a “BlogPost” model )

Options

  • pages: Provide an array of relative page paths that you want the front matter template to apply to.

  • hide_body: Toggle the display of the body editor on or off for this Front Matter Template.

  • fields: The array of fields in this front matter template. They follow a standard format:

    • name (string) The name or key of the field
    • default (string) Default data
    • label (string) The label displayed in the CMS interface
    • hidden (boolean) Toggle display of the field in the interface on or off
    • type (string) The field type.
    • description (string) Help text that appears above the field
    • config (object) Field-specific configuration options
    • fields (array) An array of fields.