Demo Brand Demo Brand

Conditions

{{condition}} blocks keep or drop content. Conditions only accept variable references; the namespace decides when the block collapses: var.* / global.* / component.X.* / self.* collapse at publish (Tier 1) and never appear in the cached pre_rendered HTML, while geo.* / param.* / ua.* survive into the cache and collapse on every request (Tier 2). View this page's production source to confirm the Tier-1 blocks are simply gone. A bare {{condition}} closes the nearest open block; blocks resolve inside-out via a stack-based parser.

Truthy check

SourceTier 1 Β· resolves at publish
{{condition var.show_promo}}
  <div class="demo-banner">{{var.promo_copy}}</div>
{{condition}}
Rendered
πŸŽ‰ Launch week: 40% off for the first 200 customers.

True values: "1", "true", "yes" (case-insensitive) or any non-empty string. The boolean SITE variable show_promo is seeded to 1 β€” flip it in the panel and the banner disappears on the next publish. Without an {{else}}, a false block is removed entirely.

Truthy with {{else}}

SourceTier 1 Β· resolves at publish
{{condition var.show_promo}}
  <p>βœ… show_promo is truthy β€” you see the first branch.</p>
{{else}}
  <p>❌ show_promo is falsy β€” you see the else branch.</p>
{{condition}}
Rendered

βœ… show_promo is truthy β€” you see the first branch.

Equality and OR lists

SourceTier 2 Β· resolves per request
{{condition geo.country="US"}}
  <p class="demo-note">πŸ‡ΊπŸ‡Έ Exact match: you are visiting from the United States.</p>
{{else}}
  <p class="demo-note">Not a US visitor β€” {{geo.country_name}} ({{geo.country}}).</p>
{{condition}}
Rendered

Not a US visitor β€” ().

SourceTier 2 Β· resolves per request
{{condition geo.country="US,CA,GB"}}
  <p class="demo-note">Comma list = OR: you matched one of US, CA, GB.</p>
{{else}}
  <p class="demo-note">You matched none of US, CA, GB.</p>
{{condition}}
Rendered

You matched none of US, CA, GB.

Nesting β€” resolved inside-out

SourceTier 1 Tier 2
{{condition var.show_promo}}
  {{condition geo.country="US"}}
    <p class="demo-note">Promo on + US visitor.</p>
  {{else}}
    <p class="demo-note">Promo on + non-US visitor ({{geo.country_name}}).</p>
  {{condition}}
{{else}}
  <p class="demo-note">Promo is off β€” the inner geo condition was never evaluated.</p>
{{condition}}
Rendered

Promo on + non-US visitor ().

A Tier-1 outer condition wrapping a Tier-2 inner one: if the outer is false at publish, the whole block (inner included) is stripped immediately. When the outer is true, the inner geo block survives into the cache and collapses per request.

One example per namespace

SourceTier 1 Β· resolves at publish
{{condition global.brand_name="Demo Brand"}}
  <p>global.* equality: the global brand_name is "Demo Brand".</p>
{{condition}}
Rendered
SourceTier 2 Β· resolves per request
{{condition param.utm_source="fb"}}
  <p class="demo-note">πŸ‘€ param.*: you arrived with ?utm_source=fb.</p>
{{else}}
  <p class="demo-note">param.*: add <code>?utm_source=fb</code> to the URL to flip this branch.</p>
{{condition}}
Rendered

param.*: add ?utm_source=fb to the URL to flip this branch.

SourceTier 2 Β· resolves per request
{{condition ua.device="mobile"}}
  <p class="demo-note">πŸ“± ua.*: you are on a mobile device.</p>
{{else}}
  <p class="demo-note">πŸ–₯ ua.*: you are on a {{ua.device}} device (not mobile).</p>
{{condition}}
Rendered

πŸ–₯ ua.*: you are on a desktop device (not mobile).

self.* β€” variant selection inside a component

A {{condition self.name…}} block resolves during component expansion (Tier 1, in the component's own scope) against the same precedence chain as a {{self.name}} output tag: inline arg β†’ panel row β†’ schema default. This is how variant-driven components select a skin. The demo-alert body:

<!-- component: demo-alert -->
{{condition self.variant="success"}}
  <div class="demo-alert demo-alert--success">βœ” {{self.message}}</div>
{{else}}
  {{condition self.variant="warning"}}
    <div class="demo-alert demo-alert--warning">⚠ {{self.message}}</div>
  {{else}}
    <div class="demo-alert demo-alert--info">β„Ή {{self.message}}</div>
  {{condition}}
{{condition}}
SourceTier 1 Β· resolves at publish
{{component.demo-alert variant="success" message="variant=success selected the success branch."}}
{{component.demo-alert variant="warning" message="variant=warning selected the warning branch."}}
{{component.demo-alert message="No variant arg β€” the schema default (info) selected the else branch."}}
Rendered
βœ” variant=success selected the success branch.
⚠ variant=warning selected the warning branch.
β„Ή No variant arg β€” the schema default (info) selected the else branch.

A self.* condition has no meaning outside its component, so it always collapses at expansion and never reaches the cache. A {{condition component.Slug.varname}} at page level works the same way against that component's variables.