Just $69.00 per license
Compatibility: | EE2, EE3, EE4, EE5 |
---|---|
Latest release: | 3.3.1 (released 2020-03-23) |
Licensing: | Commercial License Agreement |
Low Variables Fieldtype
Low Variables 2.0.0 introduces the Low Variables Fieldtype. You can now choose to add a list of variables to your publish page, outputting the variable name. You can use that in other tags, like the {exp:low_variables:parse} tags. Per Low Variables field, the following settings apply:
Setting | Description |
---|---|
Allow multiple | Enable to allow the selection of multiple variables. When disabled, the field will display as a drop-down field. When enabled, it will display as a list of checkboxes. |
Variable groups | Limit the selectable variables by variable group. |
Please note that only non-hidden and variables with early parsing disabled show up in the variable list in the Publish Form.
The value of the field will be the variable name, for example: my_var
. To output the variable name as a variable itself,
add the suffix :var
to your channel field name, for example: {my_channel_field:var}
. This will output
{my_var}
, which will be parsed by the ExpressionEngine template parser at a later stage.
Examples
Say you have 5 different testimonial quotes stored as variables in the variable group Quotes, named lv_quote_1
to lv_quote_5
. To each News entry, you want to add one of those quotes. Then add a Low Variables field to your News field group, eg. news_quote
. Then select the Quotes group in the field settings. To output the quote, you’d need code like this:
{exp:channel:entries channel="news"}
<h2>{title}</h2>
{news_intro}
{if news_quote}<blockquote><p>{news_quote:var}</p></blockquote>{/if}
{/exp:channel:entries}
You can use additional data by feeding the field value to the Low Variables template tag parameter, for example:
{exp:channel:entries channel="news"}
<h2>{title}</h2>
{news_intro}
<div class="meta">
<p>{exp:low_variables:label var="{news_quote}"}:</p>
<blockquote>{exp:low_variables:single var="{news_quote}" format="textile"}</blockquote>
</div>
{/exp:channel:entries}
If you’re allowing for multiple selections, you can use the channel field as a variable pair. In that case, use the variable {var}
to output the variable name. For example:
{exp:channel:entries channel="news"}
<h2>{title}</h2>
{news_intro}
{news_quotes}
<blockquote><p>{{var}}</p></blockquote>
{/news_quotes}
{/exp:channel:entries}