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/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_.
0 commit comments