Variable types
Pro Variables comes with over a dozen variable types. Each type has its own specific settings. You can select which types are available by (de)selecting them in the settings.
Checkbox
Displays a single checkbox with optional label. Its value is either y (checked) or blank (unchecked).
Settings
Label
Custom label added to a single checkbox.
Checkbox Group
Displays multiple checkboxes, based on given options. Its value is a list of checked values, separated by the chosen separator.
Settings
Options
A textarea field to list multiple options for selection. Put each option on a new line. Optionally use :
(space colon space) to separate values and labels.
Separator
Character to separate multiple values. Either a new line (\n
), a pipe (|
) or a comma (,
). If your values contain one of these characters, don’t use that as separator.
Date
Displays a date picker. To output anything other than a timestamp, use the {exp:pro_variables:single}
tag. This takes the same parameters as the native Date field. Additionally, use modifier="relative"
to output a relative date string.
Code examples
{exp:pro_variables:single var="my_var" format="%Y-%m-%d"}
{exp:pro_variables:single var="my_var" modifier="relative"}
File
Uses the native File field. To output the variable, always use the {exp:pro_variables:pair}
or {exp:pro_variables:single}
tag where appropriate. If you try to address the variable by name only, it will return the content unparsed, e.g. {file:XX:url}
. You can use File field parameters and variables using these tags. Additionally, one more parameter is available:
Parameters
modifier
Allows applying modifiers, which, among other, are used to apply on-the-fly image manipulations to files
Grid
Uses the native Grid field. All native types are available, except for Relationships and Members. To output the variable, use the {exp:pro_variables:pair}
or {exp:pro_variables:single}
tag where appropriate. You can use any of Grid’s parameters and variables using these tags. Additionally, one more parameter is available:
Parameters
modifier
Any of the available modifiers, which will trigger the output the modifier provides.
Code examples
{exp:pro_variables:pair var="my_var"}
<figure>
<img src="{my_var:image}">
<figcaption>Photo by {my_var:credit}</figcaption>
</figure>
{my_var:description}
{/exp:pro_variables:pair}
{exp:pro_variables:single var="my_var" modifier="total_rows"}
Radio Group
Displays multiple radio buttons, based on given options. Its value is the value of the checked item.
Settings
Options
A textarea field to list multiple options for selection. Put each option on a new line. Optionally use :
(space colon space) to separate values and labels.
Textarea (Rich Text)
Uses the native Rich Text Editor fieldtype. The height of the field can be set, as well as the text direction.
Settings
Rows
Number of rows (height) of the textarea field.
Text direction
Left to Right or Right to Left.
Display wide field
If set to Yes, the field will be shown in full width.
Note: always use the Tag syntax to output the formatted content.
Select
Displays either a drop down list box or multiple list box, based on given options. Its value is either the single selected item or a list of selected items, separated by the chosen separator. You can also select an interface that is used for multiple selection.
Settings
Options
A textarea field to list multiple options for selection. Put each option on a new line. Optionally use :
(space colon space) to separate values and labels.
Multiple
Option to allow multiple items to be selected.
Separator
Character to separate multiple values. Either a new line (\n
), a pipe (|
) or a comma (,
). If your values contain one of these characters, don’t use that as separator.
Interface
For multiple selections, you can choose different interfaces. Multiple Select element will show a regular select element. Drag and drop lists will show two lists of unselected and selected items. You can drag items across these lists and put them in a preferred order as well.
Select Categories
Displays either a drop down list box or multiple list box of categories, based on the selected Category Groups. Its value is either the category id of the single selected item or a list of selected category ids, separated by the chosen separator. You can also select an interface that is used for multiple selection.
Settings
Category groups
Limit selectable categories to these category groups.
Multiple
Option to allow multiple items to be selected.
Separator
Character to separate multiple values. Either a new line (\n
), a pipe (|
) or a comma (,
). If your values contain one of these characters, don’t use that as separator.
Interface
For multiple selections, you can choose different interfaces. Multiple Select element will show a regular select element. Drag and drop lists will show two lists of unselected and selected items. You can drag items across these lists and put them in a preferred order as well.
Select Channels
Displays either a drop down list box or multiple list box of weblogs/channels, based on the selected weblogs/channels. Its value is either the weblog/channel short name of the single selected item or a list of selected weblog/channel short names, separated by the chosen separator. You can also select an interface that is used for multiple selection.
Select Channels
Limit selectable channels to these channels.
Settings
Multiple
Option to allow multiple items to be selected.
Separator
Character to separate multiple values. Either a new line (\n
), a pipe (|
) or a comma (,
). If your values contain one of these characters, don’t use that as separator.
Interface
For multiple selections, you can choose different interfaces. Multiple Select element will show a regular select element. Drag and drop lists will show two lists of unselected and selected items. You can drag items across these lists and put them in a preferred order as well.
Select Entries
Displays either a drop down list box or multiple list box of entries, based on filters by Future or Expired entries, Channels, Categories and Statuses. You can also set the order of the entries and limit them to a certain number. Its value is either the entry id of the single selected item or a list of selected entry ids, separated by the chosen separator. You can also select an interface that is used for multiple selection.
Settings
Future entries
Adds future entries to the entry list.
Expired entries
Adds expired entries to the entry list.
Channels
Select which channels the entry list is filtered by.
Categories
Select which categories the entry list is filtered by.
Statuses
Select which statuses the entry list is filtered by.
Order by
Sort entry list either by Title or Entry date, in ascending or descending order.
Limit entries
Maximum number of entries to show in the entry list.
Multiple
Option to allow multiple items to be selected.
Separator
Character to separate multiple values. Either a new line (\n
), a pipe (|
) or a comma (,
). If your values contain one of these characters, don’t use that as separator.
Interface
For multiple selections, you can choose different interfaces. Multiple Select element will show a regular select element. Drag and drop lists will show two lists of unselected and selected items. You can drag items across these lists and put them in a preferred order as well.
Select Files
Displays either a drop down list box or multiple list box of files, based on the selected folders. Its value is either the full URL of the single selected file or a list of selected files, separated by the chosen separator. You can also optionally define an Upload Destination for new files. You can also select an interface that is used for multiple selection.
Settings
Folders
Limit selectable files to these upload destinations.
Upload folders
Select target folder for new files, or set to No uploads to hide the upload form.
Multiple
Option to allow multiple items to be selected.
Separator
Character to separate multiple values. Either a new line (\n
), a pipe (|
) or a comma (,
). If your values contain one of these characters, don’t use that as separator.
Interface
For multiple selections, you can choose different interfaces. Multiple Select element will show a regular select element. Drag and drop lists will show two lists of unselected and selected items. You can drag items across these lists and put them in a preferred order as well. Drag and drop lists with thumbnails will show a thumbnail for each image when available, and the field will be shown in full width.
Parameters
When using the Tag syntax to display the variable, you can use additional parameters to further customize the output:
manipulation
The short name of the Image Manipulation you want to output. Alternatively, you can use {var_name:manipulation}
in the tag pair.
Code examples
{exp:pro_variables:single var="lv_files_var" manipulation="squared"}
{exp:pro_variables:pair var="lv_files_var"}
<img src="{lv_files_var:squared}" alt="">
{/exp:pro_variables:pair}
Table
Displays a table of simple input fields, based on the amount of columns given. You can add unlimited rows to the table. Remove rows by emptying its values. Use the {exp:pro_variables:pair}
tag to output the content.
Settings
Columns
A pipe-delimited list of column names for the table,
eg. URL | Link text
Display wide field
If set to Yes, the field will be shown in full width.
Parameters
When using the module tags to display the table variable, you can use additional parameters to further customize the output:
sort
asc
, desc
or random
; Displays rows in ascending, descending or random order. Defaults to asc
.
limit
Limit the number of rows displayed.
Code examples
{exp:pro_variables:pair var="lv_table_var"}
{if count == 1}<ul>{/if}
<li><a href="{cell_1}">{cell_2}</a></li>
{if count == total_results}</ul>{/if}
{/exp:pro_variables:pair}
{exp:pro_variables:pair var="lv_table_var" sort="random" limit="1"}
Random link: <a href="{cell_1}">{cell_2}</a>
{/exp:pro_variables:pair}
Text Input
Displays a single line edit input field. The maxlength property can be set as well as the size of the input field. You can also define a regular expression pattern to validate the value, and the text direction of the input field.
Settings
Maxlength
Maximum number of characters allowed in this input field.
Size
Width of the input field. Large, medium, small or x-small.
Pattern
Regular Expression used to validate the value of the variable.
Text direction
Left to Right or Right to Left.
Textarea
Displays a multi-line edit input field (aka Textarea). The height of the field can be set, as well as the text direction. You can also choose to apply code formatting, which will result in a monospaced, light-on-dark version of the textarea. Textarea is the default variable type.
Settings
Text direction
Left to Right or Right to Left.
Code formatting
If enabled, it will display the textarea as a monospaced, light-on-dark input field.
Display wide field
If set to Yes, the field will be shown in full width.
Parameters
When using the module tags to display a Textarea variable, you can use additional parameters to further customize the output:
formatting
Applies formatting to the variable content. You can use xhtml
, br
or any formatting plugin like textile
. Defaults to none
.
html
To be used in combination with format
. Possible values: none
, safe
or all
. Defaults to safe
.
preparse:_my_var_
If the variable content contains variables that need to be parsed before it is put in the template, you can use this parameter, similar to embed variables. For example: setting the parameter preparse:foo="bar"
will replace the variable {preparse:foo}
with bar
in the variable content.
preparse_prefix
See above, change the default variable prefix from preparse
to something else. For example, the parameters preparse:foo="bar" preparse_prefix="lv"
will replace the variable {lv:foo}
with bar
inside the variable content.
Code examples
{exp:pro_variables:single var="my_var" formatting="xhtml" html="all"}
{exp:pro_variables:single var="my_var" preparse:entry_id="12"}