Define the recall conditions for a conditional template (Query Builder)

To define the conditions that determine when to call a specific template for a page, you need to use the Query Builder tool within the conditional templates settings.

Why do it

This feature allows you to display different layouts or content for the same type of page (for example, the Product Page) based on specific rules (e.g., the user comes from a certain source, or the page has certain characteristics).

Procedure

1. Access the settings section dedicated to Conditional page Templates.

2. Identify the type of page for which you want to create a conditional template (for example, "Product Page").

3. If the page type is not yet active, click the Activate button in the top right corner of the box.

4. Scroll down to the page-template-container section and, if there is no template present, click Add template.

5. For the newly added or to-be-modified template:

a. Fill in the field labeled What is the name of the template? (this is the name you will use to identify it).

b. Locate the field labeled Under what circumstance do you want to call this template?.

6. Click inside this field to open the Query Builder interface.

7. Use the Query Builder to define calling conditions:

  • Select the variable or parameter you want to evaluate (for example, {is-popup} to check if the page is loaded in a popup).
  • Define the logical operator (e.g., Is, Is Not, Contains).
  • Enter the value to compare against.

8. You can combine multiple conditions using logical operators AND or OR to create complex rules.

9. Once all conditions are defined, close the Query Builder. The conditions will be automatically saved in the text field.

10. Save the general changes of the settings page.

> Note: The first conditional template that meets the defined conditions will be displayed. The order in which templates appear in the list is crucial.