Template Data
Last updated
Was this helpful?
Last updated
Was this helpful?
The Elements CMS gives you full control over how your content is displayed by supporting the templating language — a fast, secure, and flexible engine widely used in modern content systems.
With Twig, you can dynamically output content, apply filters, and build custom logic directly into your website.
Inside of a Collection, Collection Item, and Static Item component you have access to the following data.
title
{{item.title}}
date
{{item.date}}
url
{{item.url}}
slug
{{item.slug}}
datePublished
{{item.datePublished}}
dateModified
{{item.dateModified}}
body
{{item.body}}
raw body
{{item.bodyRaw}}
status
{{item.status}}
featured
{{item.featured}}
image
{{item.image}}
excerpt
{{item.excerpt}}
Current Page
{{pagination.currentPage}}
Per Page
{{pagination.perPage}}
Total Items
{{pagination.totalItems}}
Last Page
{{pagination.lastPage}}
This object, combined with Twig, will allow you to build custom pagination to suite your project's needs.
For example, if you need to ensure your title is uppercased you could append a pipe and upper text to the item.title tag, like this:
Outputs: Hello world!
Outputs: HELLO WORLD!