Templating Guide

this

Each template gets a this object. If you’re looking at an Entry, the this will be filled with that Entry’s content. If you’re on a Page, it’ll have the Page’s content. If you’re ever confused, you can enable debugMode in your site’s configuration which will log this to your browser’s console.

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

The flint Object

Every template has access to the flint object. This is a big object containing a ton of information, like all of the sections, entries and users your website has. For example, if you wanted to loop through all of the sections and show each one’s title:

<ul>
  {% for section in flint.sections %}
    <li>{{ section.title }}</li>
  {% endfor %}
</ul>

Flint Object Properties

Property Name Description
pages An array of PageModels.
sections An array of SectionModels.
entries An array of EntryModels.
users An array of UserModels.
fields An array of FieldModels.
user groups An array of UserGroupModels.
assets An array of AssetModels.
site A SiteModel object.

Find a mistake or want to help improve this documentation? Suggest changes on GitHub.