Languages

Menus, Queries, And Globals

Language-aware themes need menus, queries, and global settings to follow the current language.

Globals#

{{ globals }} resolves values for the current language first.

If a translated global value is missing, TemplateX falls back to the default-language global value.

Navigation stays theme-owned.

A template can keep using {{ nav:header }} while the runtime looks for a current-language menu location such as header_nl before falling back to header.

When a menu falls back to the default-language menu, TemplateX still rewrites internal menu URLs into the current language and uses translated post/page labels when available.

Root-relative links in templates, such as / or /about/, are emitted through the current language URL helper so a Dutch page keeps visitors on /nl/ routes.

Menu loop state is translation-aware. is_current and is_parent compare menu items by their source translation group.

Queries#

TemplateX query loops automatically filter to the current language.

Use language="all" when a query should intentionally show content from every language:

php
{{ query:posts language="all" }}  <h2>{{ title }}</h2>{{ /query:posts }}

When a normal current-language post query has no results, TemplateX falls back to the default language. Explicit language queries such as language="nl", language="default", or language="all" do not fall back.