Front Matter

Front Matter allows you to extract YAML data from specially-formatted comments at the top of your twig templates. This is especially useful for including a living pattern library inside your Craft CMS project.

Defining data

title: Link
description: >
    This is a tiny component for rendering a single link.

        {% include "_components/link" with {
            url: '',
            text: 'Google',
        } %}
    text: The text to use as the body of the link
    url: The url of the target
    - text: Craft CMS
    - text: Google

<a href="{{ url }}">{{ text }}</a>

Accessing Data

You can access the YAML data as an array from other templates with craft.frontMatter.parse(template):

{% set component = craft.frontMatter.parse("_components/link") %}

<h2>{{ component.title }}</h2>

{{ component.description|markdown }}


Package Name

To install this plugin, search for its package name on the Plugin Store and click “Install”.


  • Version 1.1.0
  • Last Update 12/15/2018
  • Active Installs 3
  • Compatibility Craft 3
  • License MIT
  • Categories Templating

Report an issue