Open navClose nav

Text Field

Options

https://res.cloudinary.com/forestry-demo/image/fetch/c_limit,dpr_auto,f_auto,q_80,w_640/https://forestry.io/uploads/2018/01/text-options.png

  • Label – the human-friendly label shown above the input field in the editor.
  • Name – the key stored in your content’s front matter, used to access it in your templates.
  • Description – a human friendly description of what the field does and/or instructions for your editors.
  • Hidden – hides the field in the editor, but allows developers to set default values or maintain the field for legacy purposes.
  • Required – prevent changes from being saved if this field is empty.

Field UI

https://res.cloudinary.com/forestry-demo/image/fetch/c_limit,dpr_auto,f_auto,q_80,w_640/https://forestry.io/uploads/2018/01/text-preview.png

Templating

You can access this field in your templates using the field’s name:

Hugo

<h1>{{ .Title }}</h1> 

Jekyll

<h1>{{ page.title }}</h1>

VuePress

<template>
  <h1>{{ $page.frontmatter.title }}</h1>
</template>

Config Files

You can configure this field in Front Matter Template Config Files as follows:

type: text
name: [String]
label: [String]
description: [String]
hidden: [true|false]
default: [String]
config:
  required: [true|false]

Example

type: text
name: title
label: Title
hidden: false
default: ""
config:
  required: true

Last updated on December 31, 2017