What theme templates can use
Templates run in a restricted version of Twig. They can use the features in this topic and nothing else. Using anything else is an error when the theme is checked, even in a part of a template that never runs.
Tags: if, for, set, block, extends, use, include, embed, apply, macro, import, from
Filters: escape, e, upper, lower, capitalize, trim, date, length, slice, join, split, default, merge, sort, first, last, map, filter, keys, json_encode, number_format, replace, striptags, url_encode, excerpt, content_sections
Functions: asset, include, min, max, parent, block, paligo_search_box, paligo_search_results, paligo_breadcrumbs, paligo_toc, paligo_pager, paligo_language_switcher, paligo_contrast_color, related_pages
Tests: all of Twig's tests except constant, such as defined, empty, null, iterable, even, odd, same as and divisible by
Not available, among others:
The
rawfilter. The HTML that Paligo provides already prints as HTML.range()and the..operator. Loop over a list instead.attribute(). Use brackets, such asitem[key].template_from_string(),constant(),random(),cycle(),dump()andsource().The
with,autoescape,do,spacelessandsandboxtags.Calling methods or reading properties of objects. Every value in a template is a text, number, list or map.
For how Twig works, see the Twig documentation.