Skip to content

Static resolution

Prefix a template path with a namespace handle to skip the lookup order and use that namespace only:

{# templates/groups/mygroup/header.twig #}
{% include '@mygroup/header.twig' %}
{# templates/sites/mysite/header.twig #}
{% include '@mysite/header.twig' %}
{# templates/_global/header.twig #}
{% include '@global/header.twig' %}

If the template doesn’t exist in that namespace, Craft throws a TemplateNotFound exception.

The @ is the configurable prefix, and only namespaces with a handle can be addressed this way.