Just $69.00 per license
Compatibility: | EE2, EE3, EE4, EE5 |
---|---|
Latest release: | 3.3.1 (released 2020-03-23) |
Licensing: | Commercial License Agreement |
Template tags
In most cases, the simple global variable syntax, eg. {my_var}
will do. Global variables
do not support parameters, nor do they support the variable pair syntax. However, tags do.
Parse tag
{exp:low_variables:parse var="my_var"}
Use the Parse, Single or Pair tag to parse variables during the Module & Plugin stage (read more about the parsing stages). You can also use parameters, which will allow for more options than just using the variable syntax. Some variable types, like RTE and Grid, require using the tag syntax to trigger additional processing.
Note: Whenever you need parameters or additional processing, use the tag syntax rather than the variable syntax.
Parameter | Description |
---|---|
var |
Name of the variable you want to parse. Use a colon to separate site name and variable name if you want to parse a variable belonging to a specific site, eg. my_site:my_var . If this parameter is omitted,
all Low Variables inside the tag pair are simply replaced with their values. |
multiple |
If set to yes , the tag will loop through the different values of the variable.
This parameter applies to any of the native variable types that use the separator setting:
Checkbox Group,
Radio Group and all
Select types.
Use only in combination with the var parameter.
Not needed in EE3.
|
limit |
Use in combination with multiple="yes" to limit the number of results displayed. |
3rd party | If you’re displaying a 3rd party field type, you can use all parameters you would normally use for the field channel variable pair. |
Variable | Description |
---|---|
{my_var:data} |
The variable value. |
{my_var:data_label} |
The variable value’s label, when displaying a Checkbox Group, Radio Group or Select variable type. |
{my_var:label} |
The variable label, as displayed in the Control Panel. |
{my_var:count} |
Current count of the loop. |
{my_var:total_results} |
Total of iterations of the loop. |
3rd party | If you’re displaying a 3rd party field type, you can use all variables you would normally use inside the field channel variable pair. |
Note: the {my_var:…}
variables are only available when
using the Parse tag pair or Pair tag pair, and if the variable type allows multiple items to be selected.
For more options on the native variable types, check their properties.
{exp:low_variables:parse var="my_site:my_var"}
{exp:low_variables:parse}
Some code riddled with {my_var}
and {my_other_var}.
{/exp:low_variables:parse}
{exp:low_variables:parse var="my_select_var" multiple="yes"}
<p>
Number {my_select_var:count} of {my_select_var:total_results}:
{my_select_var:data} ({my_select_var:data_label})
</p>
{if no_results}No values found{/if}
{/exp:low_variables:parse}
{exp:low_variables:parse var="my_matrix_var"}
all matrix variables here
{/exp:low_variables:parse}
Single tag
{exp:low_variables:single var="my_var"}
In order to avoid conflicts with multiple instances of the Parse tag, both single and paired, you can use the alias {exp:low_variables:single} for single tag use. It is identical to the Parse tag, but meant for single tag use only.
Pair tag
{exp:low_variables:pair var="my_var"}{/exp:low_variables:pair}
In order to avoid conflicts with multiple instances of the Parse tag, both single and paired, you can use the alias {exp:low_variables:pair} for tag pair use. It is identical to the Parse tag, but meant for tag pair use only.
Label tag
{exp:low_variables:label var="my_var"}
You can display the label of any variable by using this tag. Use as single tag only.
Parameter | Description |
---|---|
var |
Name of the variable you want to fetch the label from. Use a colon to separate site name and variable name
if you want to parse a variable belonging to a specific site, eg. my_site:my_var .
This is a required parameter.
|
Options tag
This tag pair allows you to display the options for a given variable. Use this in combination with the Checkbox Group, Radio Group and Select variable types.
Parameter | Description |
---|---|
var |
Name of the variable you want to parse. Use a colon to separate site name and variable name
if you want to parse a variable belonging to a specific site, eg. my_site:my_var .
This is a required parameter.
|
Variable | Description |
---|---|
{my_var:data} |
Value of the option. |
{my_var:data_label} |
Associated label of the value. |
{my_var:label} |
Label of the variable itself. |
{active} |
Set to y if the variable data contains the current option. |
{checked} |
Returns checked="checked" if current option is active. |
{selected} |
Returns selected="selected" if current option is active. |
{total_results} |
The total amount of options. |
{count} |
The count out of the current option. |
{exp:low_variables:options var="my_multi_var"}
{if count == 1}<ul>{/if}
<li{if active == "y"} class="active"{/if}>{my_multi_var:data_label}</li>
{if count == total_results}</ul>{/if}
{/exp:low_variables:options}
<select name="options">
{exp:low_variables:options var="my_site:my_multi_var"}
<option value="{my_multi_var:data}"{selected}>{my_multi_var:data_label}</option>
{/exp:low_variables:options}
</select>