Learn

Content Files

Content files are broken into two sections.

Every content file you create — whether you make them manually or through the Control Panel — is broken into two parts: YAML front matter (or the variables) and the page’s content. Each section starts with a three-hyphen divider (---), so that a full file would look something like this:

---
title: About Us
description: Learn a little bit about our company.
---
We are a team of strong individuals.
We also greatly enjoy scotch.
We consume alcohol as a team.

YAML Front Matter

Your YAML front matter is everything after the first hyphen-divider (---) and before the second. This is where you define variables per page. You can create new variables here for use in your templates or overwrite ones defined in your site settings.

This section is parsed as YAML (like the name suggests), so anything you can do with YAML is possible here. It’s called front matter because it’s listed in front of your content.

note Names that you use for variables are case-sensitive.

For example, title and Title are seen as two different variables. Because of this, we recommend using all-lowercase names for your variables. You don’t have to, but mixing and matching may lead to confusion down the road.

Content

Your content is everything after the second hyphen-divider. This data will be placed within the {{ content }} tag for use within templates. Whatever you enter into this area will be run through the content markup parser you’ve chosen with the _content_type settings in your general site settings. If your setting is markdown, this area will be parsed for Markdown, etc.

Using Statamic Tags in your Content

It’s possible to use Statamic tags within your content area, but when doing this, it’s important to keep in mind the parse order. You can define the order in which Statamic parses your content with the _parse_order setting in your settings.yaml file.

Ordering your _parse_order to parse content before tags (the default order), Statamic will parse your content for Markdown or Textile first, and then it replaces your Statamic tags with their values. Flipping the order to be tags first and content second, Statamic replaces tags in your content with their values, and then parses it for Markdown or Textile.

note Unless you absolutely need to change this, we recommend leaving the parse order alone.

This article was last updated on September 13th, 2016. Find an error? Please let us know!