Learn

Core Template Tags

Pull content around your site.

Core template tags are the tags that Statamic provides to let you do amazing things without a lot of work. You’ve learned about single variables and tag pairs, you’ve seen that even static variables aren’t exactly static, the core template tags are the third side of the triangle.

If you can use single variables and tag pairs, you can use core template tags. They work the same way, except that they’re a bit more powerful.

An Example

The {{ entries:listing }} tag lets you grab a list of entries from any folder that you specify and print the list in your template. Let’s say that you have a blog content folder, within which are all of your blog entries. We want to pull a list of the five most recent blog entries onto our homepage. In the template that our homepage will use, we add this:

<ul>
   {{ entries:listing folder="blog" limit="5" sort_dir="desc" }}
      <li><a href="{{ url }}">{{ title }}</a></li>
   {{ /entries:listing }}
</ul>

This code does that. Between the start and end tags, you can use any of the variables in that entry’s YAML front matter, any tags available on your current page (including global settings), and any of the helpers (like {{ url }}) that the tag provides.

Using the Documentation

The core template tags are where you’ll want to dive into the documentation. Among many other things, Statamic’s documentation provides a complete list of all the core template tags available, including a list of all of the parameters that each tag takes.

View the complete list of core template tags available.

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