When the interpreter finds an If, it expects a boolean condition – for example ”<#x> > 0”, which means “the variable x contains a number that is greater than zero” – and evaluates that condition. If the condition is true, the content of the param “true” is returned, otherwise the content of the param “false” is returned.
Name | Mandatory | Description |
---|---|---|
Condition | Yes | A boolean condition or a number (0 evaluate to false and all other numbers to true). Operators supported: + - * / ( ) OR AND. The tags in the condition are always evaluated before the condition is calculated. |
True | No | The content (html text or template filename) to return if the condition evaluate to true |
False | No | The content (html text or template filename) to return if the condition evaluate to false |
<#if condition=“condition”>true result<#endif>
If the expression specified in condition is true, the contents of the <#if> tags will be output, otherwise nothing will be output.
<#if condition=“condition”>true result<#elseif condition=“condition”>true result<#endif>
Used in conjunction with <#if>, this allows a secondary condition to be checked and the true result to be output if the condition is met.
<#if condition=“condition”>true result<#else>false result<#endif>
Used in conjunction with <#if>, the false result will be output if the <#if> condition failed, and so did any <#elseif> checks.
<#if condition="('<#page_title>' = '') and (<#url_PageNumber> > 1)" true="the page title is empty and the page number is greater than 1" false="the page title is NOT empty or the page number is NOT greater than 1"> <#if condition="('#page_title' = '') and (#url_PageNumber = 1)"> the page title is empty and the page number is equal to 1 <#else> the page title is NOT empty or the page number is NOT greater than 1 <#endif>