[en] What theme templates can use
[en] 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.
[en] Tags: if, for, set, block, extends, use, include, embed, apply, macro, import, from
[en] 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
[en] 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
[en] Tests: all of Twig's tests except constant, such as defined, empty, null, iterable, even, odd, same as and divisible by
[en] Not available, among others:
[en] The
rawfilter. The HTML that Paligo provides already prints as HTML.[en]
range()and the..operator. Loop over a list instead.[en]
attribute(). Use brackets, such asitem[key].[en]
template_from_string(),constant(),random(),cycle(),dump()andsource().[en] The
with,autoescape,do,spacelessandsandboxtags.[en] Calling methods or reading properties of objects. Every value in a template is a text, number, list or map.
[en] For how Twig works, see the Twig documentation.