You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/add-ons/pro-variables/fieldtype.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,9 @@ The value of the field will be the _variable name_, for example: `my_var`. To ou
27
27
28
28
## Examples
29
29
30
-
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 Pro 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:
30
+
Say you have 5 different testimonial quotes stored as variables in the variable group Quotes, named `pv_quote_1` to `pv_quote_5`. (Remember, you can create these in one pass using the (suffix option)[/add-ons/pro-variables/manage.md#variable-creation-options].)
31
+
32
+
To each News entry, you want to add one of those quotes. Then add a Pro 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:
31
33
32
34
{exp:channel:entries channel="news"}
33
35
<h2>{title}</h2>
@@ -54,4 +56,4 @@ If you’re allowing for multiple selections, you can use the channel field as a
Copy file name to clipboardExpand all lines: docs/add-ons/pro-variables/manage.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,11 +17,11 @@ There are a couple of extra properties you can assign to variables, other than t
17
17
18
18
### Variable name
19
19
20
-
Name of the variable you can use in your templates. Example: `lv_my_special_var`.
20
+
Name of the variable you can use in your templates. Example: `pv_my_special_var`. You can use (`{suffix}`)[#variable-creation-options] in this setting.
21
21
22
22
### Variable label
23
23
24
-
The label a user sees when editing the contents of the variable.
24
+
The label a user sees when editing the contents of the variable. You can use (`{suffix}`)[#variable-creation-options] in this setting.
25
25
26
26
### Variable notes
27
27
@@ -37,21 +37,27 @@ You can hide variables from regular users (non-managers) on a per-variable basis
37
37
38
38
### Early parsing
39
39
40
-
You can enable early parsing on a per-variable basis.
40
+
You can enable early parsing on a per-variable basis, if this is enabled overall in Pro Variable settings.
41
41
42
42
### Variable type
43
43
44
44
Choose any variable type that suits your needs best. [Here’s a list of variable types that come with Pro Variables.](/add-ons/pro-variables/type.md) Each type will reveal additional type-specific properties.
45
45
46
46
## Variable creation options
47
47
48
-
When creating a new variable, you have two extra options you can use. First, you can **set the initial value** of the variable, so it has a value upon creation. Second, you can enter any amount of **suffixes**, separated by a space. A new variable will be created for each suffix entered, each with identical settings apart from the suffix.
48
+
When creating a new variable, you have two extra options you can use.
49
+
50
+
First, you can **set the initial value** of the variable, so it has an existing value upon creation.
51
+
52
+
Second, you can enter any amount of **suffixes**, separated by a space. A new variable will be created for each suffix entered, each with identical settings apart from the suffix.
49
53
50
54
When using the suffix option, you can use `{suffix}` in both the variable name as the variable label. This will be replaced by the actual suffix upon creation.
51
55
56
+
NOTE: You can use this for language options (en fr de nl), for creating a set of numbered fields (1 2 3 4), for creating a collection of fields for social media links (fb tiktok instagram linkedin), and more.
57
+
52
58
## Variable groups
53
59
54
-
You can create any number of groups to organize your variables. These groups will appear in the Group drop down for each variable, so you can assign a group to it. On the module home page, variable managers can sort the groups using drag and drop. Variable managers can also edit and delete the groups from here, by clicking on the edit or delete icon next to the group name. You can alter the variable order in a group by editing the group’s properties.
60
+
You can create any number of groups to organize your variables. These groups will appear in the Group dropdown for each variable, so you can assign a group to it. On the module home page, variable managers can sort the groups using drag and drop. Variable managers can also edit and delete the groups from here, by clicking on the edit or delete icon next to the group name. You can alter the variable order in a group by editing the group’s properties.
55
61
56
62
57
63
### Group label
@@ -81,4 +87,4 @@ If you want to duplicate the group variables, enter a single suffix to be applie
81
87
82
88
## Suffix options
83
89
84
-
You can choose to either _append_ the suffix to each new variable, or to _replace_ an existing suffix for each new variable. Please note that the suffix is considered to be the part of the variable name _after the last underscore_.
90
+
You can choose to either _append_ the suffix to each new variable, or to _replace_ an existing suffix for each new variable. Please note that the suffix is considered to be the part of the variable name _after the last underscore_.
Copy file name to clipboardExpand all lines: docs/add-ons/pro-variables/settings.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,19 +13,21 @@
13
13
14
14
### Select Variable Managers
15
15
16
-
Select the member groups that are allowed to manage the variables, rather than just editing their contents.
16
+
Select the member groups that are allowed to manage the variables (create, modify settings, delete), rather than just editing their contents. Overall access to Pro Variables is controled in the Member Role settings under "Allowed add-on access," but by default only Super Admins can manage variables -- all other member roles will only have access to edit the variables.
17
17
18
18
### Clear cache
19
19
20
-
If set to Yes, all native cache will be cleared after variables are saved. If set to Ask, a checkbox will appear next to the Save Changes button to optionally clear the cache. It will be unchecked by default with opt-in, checked by default with opt-out.
20
+
If set to No, changing a Pro Variable will never clear the cache. If set to Yes, all native cache will be cleared whenever any variables are saved. If set to "Optionally", you will see two buttons: "Save Variables" and "Save and Clear Cache" to optionally clear the cache.
21
21
22
22
### Enable early parsing?
23
23
24
-
Choose if variables can be parsed early in the parsing order; before or after existing Snippets and config-variables. Yes, before Snippets will parse early parsed Pro Variables before Snippets and variables set in config.php; Yes, after Snippets will parse them after.
24
+
This controls the overall ability for Pro Variables to be parsed early in the parsing order. By default, which is "No," all Pro Variables will be parsed quite late in the parsing order (i.e. when Global Variables are parsed). If set to Yes at all, then you can control the parsing timing of each individual Pro Variable. If set to "Yes, before Snippets," early parsing will happen just before existing Template Partials and config variables are parsed, which means they can include Partials. If set to "Yes, after Snippets," that means EE will parse (chosen) Pro Variables just after Template Partials and variables set in config.php, so you can include Pro Variables in those places.
25
+
26
+
NOTE: You also need to turn on early parsing for each individual variable you want to exhibit this behavior.
25
27
26
28
WARN: Use caution when turning on this feature, as users could potentially break your templates!
27
29
28
30
29
31
### Variable types
30
32
31
-
Here you can find a list of available Variable Types and Pro Variablescompatible Field Types. Select which types you want to enable. Disabled types will not appear in the module.
33
+
Here you can find a list of available Variable Types — Pro Variables-compatible Field Types. Select which types you want to enable. Disabled types will not be made available in the module.
Copy file name to clipboardExpand all lines: docs/add-ons/pro-variables/tags.md
+36-21Lines changed: 36 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ In most cases, the simple global variable syntax, eg. `{my_var}` will do. Global
17
17
18
18
{exp:pro_variables:parse var="my_var"}
19
19
20
-
Use the Parse, Single or Pair tag to parse variables during the Module & Plugin stage. 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.
20
+
Use the Parse, Single or Pair tags to parse variables during the Module & Plugin stage of template parsing. Parse can be used as either a single or a pair tag - but that can sometimes confuse the EE parser if it's in use both ways in a template. Like all `exp:` tags, these can be assigned parameters, which will allow for more options than just using the variable syntax. Some variable types, like File, RTE and Grid, require using the tag syntax to trigger additional processing.
21
21
22
22
TIP: TIP: **{ee:u}** Learn more about the parsing stages at [ExpressionEngine University](https://u.expressionengine.com/course/ee-conf-spring-summit-2021/eeconf-spring-2021-but-first-parse-order-and-php-in-expressionengines-templates).
23
23
@@ -27,7 +27,7 @@ NOTE: **Note:** Whenever you need parameters or additional processing, use the *
27
27
28
28
#### `var`
29
29
30
-
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 Pro Variables inside the tag pair are simply replaced with their values.
30
+
Name of the variable you want to parse. If you're using multi-site manager, use a colon to separate site name and variable name if you want to parse a variable belonging to a specific site, e.g.`my_site:my_var`. If the var parameter is omitted (it is optional with a tag pair), all Pro Variables inside the tag pair are replaced with their values.
31
31
32
32
#### `multiple`
33
33
@@ -37,38 +37,47 @@ If set to `yes`, the tag will loop through the different values of the variable.
37
37
38
38
Use in combination with `multiple="yes"` to limit the number of results displayed.
39
39
40
-
41
40
#### _3rd party_
42
41
43
42
If you’re displaying a 3rd party field type, you can use all parameters you would normally use for the field channel variable pair.
44
43
45
-
### Variables
44
+
### Variable Options
45
+
46
+
NOTE: **Note:** Some of these `{my_var:…}` variable options are available _only_ 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](/add-ons/pro-variables/type.md).
46
47
47
-
#### `{_my_var_:data}`
48
+
#### `{my_var:data}`
48
49
49
50
The variable value.
50
51
51
-
#### `{_my_var_:data_label}`
52
+
#### `{my_var:data_label}`
52
53
53
54
The variable value’s label, when displaying a Checkbox Group, Radio Group or Select variable type.
54
55
55
-
#### `{_my_var_:label}`
56
+
#### `{my_var:label}`
56
57
57
58
The variable label, as displayed in the Control Panel.
58
59
59
-
#### `{_my_var_:count}`
60
+
#### `{my_var:count}`
60
61
61
62
Current count of the loop.
62
63
63
-
#### `{_my_var_:total_results}`
64
+
#### `{my_var:total_results}`
64
65
65
66
Total of iterations of the loop.
66
67
67
68
#### _3rd party_
68
69
69
70
If you’re displaying a 3rd party field type, you can use all variables you would normally use inside the field channel variable pair.
70
71
71
-
NOTE: **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](/add-ons/pro-variables/type.md).
72
+
### Variable Modifiers
73
+
74
+
You can use [variable modifiers](templates/variable-modifiers.md) on Pro Variables when using them in a tag pair.
75
+
76
+
{exp:pro_variables:parse}
77
+
Encrypted text var: {my_text:encrypt}
78
+
{/exp:pro_variables:parse}
79
+
80
+
### Code Examples
72
81
73
82
{exp:pro_variables:parse var="my_site:my_var"}
74
83
@@ -97,15 +106,15 @@ In order to avoid conflicts with multiple instances of the Parse tag, both singl
In order to avoid conflicts with multiple instances of the Parse tag, both single and paired, you can use the alias `{exp:pro_variables:pair}` for tag pair use. It is identical to the Parse tag, but meant for tag pair use only.
103
112
104
-
You can also use [variable modifiers](templates/variable-modifiers.md) on pro variables when using them in a tag pair:
113
+
You can also use [variable modifiers](templates/variable-modifiers.md) on Pro Variables when using them in a tag pair:
105
114
106
-
{exp:pro_variables:parse}
115
+
{exp:pro_variables:pair var="my_text"}
107
116
Encrypted text var: {my_text:encrypt}
108
-
{/exp:pro_variables:parse}
117
+
{/exp:pro_variables:pair}
109
118
110
119
## Label tag
111
120
@@ -117,29 +126,33 @@ You can display the label of any variable by using this tag. Use as single tag o
117
126
118
127
#### `var`
119
128
120
-
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_.
129
+
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, e.g. `my_site:my_var`. _This is a required parameter_.
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.
125
138
126
139
### Parameters
127
140
128
141
#### `var`
129
142
130
-
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_.
143
+
Name of the variable you want to parse e.g. `var="my_var"`. 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_.
Copy file name to clipboardExpand all lines: docs/add-ons/pro-variables/type.md
+28-21Lines changed: 28 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,11 +42,11 @@ Character to separate multiple values. Either a new line (`\n`), a pipe (`|`) or
42
42
43
43
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.
@@ -58,6 +58,16 @@ Uses the native [File field](/fieldtypes/file.md). To output the variable, alway
58
58
59
59
Allows applying modifiers, which, among other, are used to apply [on-the-fly image manipulations](/fieldtypes/file.md#on-the-fly-image-manipulations) to files
60
60
61
+
### Code example
62
+
63
+
{exp:pro_variables:pair var="my_file_var"}
64
+
<figure>
65
+
<img src="{my_file_var:image}">
66
+
<figcaption>Photo by {my_file_var:credit}</figcaption>
67
+
</figure>
68
+
{my_file_var:description}
69
+
{/exp:pro_variables:pair}
70
+
61
71
## Grid
62
72
63
73
Uses the native [Grid field](/fieldtypes/grid.md). 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](/fieldtypes/grid.md#parameters) and [variables](/fieldtypes/grid.md#variables) using these tags. Additionally, one more parameter is available:
@@ -68,17 +78,9 @@ Uses the native [Grid field](/fieldtypes/grid.md). All native types are availabl
68
78
69
79
Any of the available [modifiers](/fieldtypes/grid.md#modifiers), which will trigger the output the modifier provides.
@@ -356,14 +361,16 @@ To be used in combination with `format`. Possible values: `none`, `safe` or `all
356
361
357
362
#### `preparse:_my_var_`
358
363
359
-
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](/templates/embedding.md#embedding-variables). For example: setting the parameter `preparse:foo="bar"` will replace the variable`{preparse:foo}` with `bar` in the variable content.
364
+
If the variable content itself contains variables that ought to be parsed before the Pro Variable is put in the template, you can use this parameter. It's similar to [embed variables](/templates/embedding.md#embedding-variables). For example: setting the parameter `preparse:foo="bar"` will replace `{preparse:foo}` with `bar` in the variable content.
360
365
361
366
#### `preparse_prefix`
362
367
363
-
See above, change the default variable prefix from `preparse` to something else. For example, the parameters `preparse:foo="bar" preparse_prefix="pv"` will replace the variable`{pv:foo}` with `bar` inside the variable content.
368
+
Used with pre-parsing, this changes the default variable prefix from `preparse` to something else. For example, the parameters `preparse_prefix="pv" preparse:foo="bar"` will replace `{pv:foo}` with `bar` inside the variable content.
0 commit comments