Modules / Multilingual

Multilingual: language conditions & templates

Multilingual: language condition and per-language templates

Show an element only in some languages, give each language its own header, footer or theme style, and see each page's language in the builder's Pages panel. For Polylang and WPML.

#28 of 39 modules by votes

  • On by default
  • Needs Bricks 2.4 or newer, and Polylang or WPML
  • Tested with Bricks 2.4.3

Tile 28 of 39, ranked by votes · Recording in progress

Where to find it in the builder

  • Element conditions: Language, in the Kiln group.
  • Template conditions and theme-style conditions: Language (Kiln).
  • The builder's Pages panel: each page title starts with its language code, for example [DE] Startseite.

How to use it

An element in one language only

  1. Select the element and open its Conditions.
  2. Add the condition Language from the Kiln group.
  3. Choose is or is not, then the language.

A header, footer or theme style per language

  1. Open the template's settings (or the theme style's Conditions).
  2. Add a condition and choose Language (Kiln).
  3. Pick one or more languages.

How Bricks combines conditions

Bricks scores every condition row of a template on its own and uses the highest score. Rows are combined with OR, so "Post type: Post" plus "Language: German" on one template means "any post, or anything in German", not "German posts". Make one template per language instead.

A language row scores 5. That beats "Entire website" (2), "All archives" (3) and "All terms" (4), and loses to a post-type condition (7) or a specific page (8 to 10).

Theme styles load one at a time by default: on a German page, a German-only theme style replaces your site-wide style completely, not just the settings it changes. Either copy the site-wide settings into it, or set Bricks > Settings > General > Theme styles: Loading method to Load all matching theme styles, so the German style only adds to the site-wide one.

Limits

  • Exclude is hidden on language rows: Bricks only lets its own conditions exclude.
  • On the front end, the condition uses the page's language. When WPML shows an English post at a German URL ("display as translated"), the German header and style apply.
  • Polylang is tested. WPML support follows WPML's documented API and has not been tested on a live WPML site yet.

Settings

None. The module is on by default when Polylang or WPML is active.

Requirements

Bricks 2.4 or newer, and Polylang or WPML.