When using Dynamic Variables in Snippets Pro, If Structures conditionally include content based on the variables defined for that snippet.

{if variable}...{elseif another-variable}...{else}...{/if}

Testing a variable

A condition passes when the variable resolves to a non-empty, truthy value. Empty values, 0, and the values false or "false" do not pass. If no tag value was supplied, the variable's configured default is tested.

The company %company% is based in %country%{if year} and was founded in %year%{/if}.
{snippet alias="company" company="Regular Labs" country="The Netherlands" year="2008"}
The company Regular Labs is based in The Netherlands and was founded in 2008.

Prefix a variable with ! to negate the test:

{if !year}The founding year is unknown.{/if}

An explicitly empty tag attribute remains empty and does not fall back to an inline or configured default, so its positive condition does not pass.

Else and Elseif

Use {else} for the fallback branch. Both {elseif variable} and {else if variable} are accepted:

{if year}Founded in %year%.{elseif estimated-year}Founded around %estimated-year%.{else}The founding year is unknown.{/if}

Combining conditions

Combine variables with uppercase AND and OR, or with && and ||:

{if company AND year}%company% was founded in %year%.{/if}
{if featured OR promoted}This company is highlighted.{/if}

Expressions test variable truthiness only. Comparisons and parentheses are not supported. Evaluation uses AND-separated groups containing OR alternatives, so keep mixed expressions simple or use separate If Structures when the intended grouping could be unclear.

Variables must be defined

Every evaluated name must exist in the snippet's Variables tab. If a condition refers to an undefined variable, Snippets leaves that entire If Structure unchanged instead of guessing whether it should pass. Define optional variables with an empty default when you want to test them.

Dash and underscore forms address the same defined variable in conditions, just as they do in variable placeholders.