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
@@ -49,7 +49,7 @@ You can use a single variable for Checkboxes to render a comma-separated list of
49
49
50
50
### Variable Pair
51
51
52
-
Using a variable pair, allows for customization of the output.
52
+
Using a variable pair of field name, allows for customization of the output.
53
53
54
54
{field_name}
55
55
{item}<br>
@@ -63,7 +63,18 @@ Two
63
63
Three
64
64
```
65
65
66
-
By default, `{item}` will render the item's value. To access the value and label separately, simply add a `:value` or `:label` modifier to the `{item}` variable:
66
+
The following variables are available inside field's tags pair:
|`{count}`| Counter for each of selected items, starting with 1 |
74
+
|`{index}`| Counter for each of selected items, starting with 0 |
75
+
|`{total_items}`| Total number of selected items |
76
+
77
+
By default, `{item}` will render the item's label. To access the value and label separately, simply add a `:value` or `:label` modifier to the `{item}` variable:
67
78
68
79
{field_name}
69
80
Value: {item}<br> {!-- 1 --}
@@ -88,17 +99,19 @@ Given that the selection option is 2/Two:
88
99
89
100
TIP: **Tip:** It is recommended that you use the value in conditionals, as it typically will not change over time. That way, if you ever need to change the wording, spelling, or even casing of labels in your publish/edit UI, you will not need to modify your templates.
90
101
91
-
TIP: **Tip:** Checkboxes, Multiselect and Selectable Buttons all default to showing the label. Radio Buttons and Selects default to showing the value.
102
+
TIP: **Tip:** Checkboxes, Multiselect and Selectable Buttons all default to showing the label. Radio Buttons and Selects default to showing the value.
103
+
104
+
### Parameters
92
105
93
-
###Limit Parameter
106
+
#### `limit`
94
107
95
108
This parameter limits the number of selected items output by the tag. It works for both the single variable, as well as the tag pair.
96
109
97
110
```
98
111
{field_name limit="2"} {!-- One,Two --}
99
112
```
100
113
101
-
###Markup Parameter
114
+
#### `markup`
102
115
103
116
As a single tag, a checkbox will display a comma separated list of values. If you want an HTML list, you can use markup="ul" or markup="ol" to change the output to the equivalent html list
104
117
@@ -112,7 +125,7 @@ Which will render as
112
125
<li>Orange</li>
113
126
</ul>
114
127
115
-
###Backspace Parameter
128
+
#### `backspace`
116
129
117
130
When used as a tag pair, checkboxes are a looping pair. Backspacing removes characters (including spaces and line breaks) from the last iteration of the loop. For example, if you put a `<br>` tag after each item you'll have this
By default, `{item}` will render the item's value. To access the value and label separately, simply add a `:value` or `:label` modifier to the `{item}` variable:
66
+
67
+
The following variables are available inside field's tags pair:
|`{count}`| Counter for each of selected items, starting with 1 |
75
+
|`{index}`| Counter for each of selected items, starting with 0 |
76
+
|`{total_items}`| Total number of selected items |
77
+
78
+
By default, `{item}` will render the item's label. To access the value and label separately, simply add a `:value` or `:label` modifier to the `{item}` variable:
67
79
68
80
{field_name}
69
81
Value: {item}<br> {!-- One --}
@@ -88,17 +100,19 @@ Given that the selection option is 2/Two:
88
100
89
101
TIP: **Tip:** It is recommended that you use the value in conditionals, as it typically will not change over time. That way, if you ever need to change the wording, spelling, or even casing of labels in your publish/edit UI, you will not need to modify your templates.
90
102
91
-
TIP: **Tip:** Checkboxes, Multiselect and Selectable Buttons all default to showing the label. Radio Buttons and Selects default to showing the value.
103
+
TIP: **Tip:** Checkboxes, Multiselect and Selectable Buttons all default to showing the label. Radio Buttons and Selects default to showing the value.
104
+
105
+
### Parameters
92
106
93
-
###Limit Parameter
107
+
#### `limit`
94
108
95
109
This parameter limits the number of selected items output by the tag. It works for both the single variable, as well as the tag pair.
96
110
97
111
```
98
112
{field_name limit="2"} {!-- One,Two --}
99
113
```
100
114
101
-
###Markup Parameter
115
+
#### `markup`
102
116
103
117
As a single tag, a multi select will display a comma separated list of values. If you want an HTML list, you can use markup="ul" or markup="ol" to change the output to the equivalent html list
104
118
@@ -112,7 +126,7 @@ Which will render as
112
126
<li>Orange</li>
113
127
</ul>
114
128
115
-
###Backspace Parameter
129
+
#### `backspace`
116
130
117
131
When used as a tag pair, Multiselect are a looping pair. Backspacing removes characters (including spaces and line breaks) from the last iteration of the loop. For example, if you put a `<br>` tag after each item you'll have this
Copy file name to clipboardExpand all lines: docs/fieldtypes/selectable-buttons.md
+18-4Lines changed: 18 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,19 @@ When allowing multiple items to be selected, Selectable Buttons will usually be
60
60
{item}<br>
61
61
{/field_name}
62
62
63
-
By default, `{item}` will render the item's value. To access the value and label separately, simply add a `:value` or `:label` modifier to the `{item}` variable:
63
+
64
+
The following variables are available inside field's tags pair:
|`{count}`| Counter for each of selected items, starting with 1 |
72
+
|`{index}`| Counter for each of selected items, starting with 0 |
73
+
|`{total_items}`| Total number of selected items |
74
+
75
+
By default, `{item}` will render the item's label. To access the value and label separately, simply add a `:value` or `:label` modifier to the `{item}` variable:
64
76
65
77
{field_name}
66
78
Value: {item}<br>
@@ -98,11 +110,13 @@ TIP: **Tip:** Checkboxes, Multiselect and Selectable Buttons all default to show
98
110
99
111
NOTE: **NOTE:** For Select fields used in [Custom Member Fields](control-panel/member-manager.md#custom-member-fields) and [Category Group Details Tab](control-panel/categories.md#details-tab), the modifiers are not currently available in conditionals, and _must_ be based on the value, e.g. `{if some_cat_field == 2}`
100
112
101
-
### Limit Parameter
113
+
### Parameters
114
+
115
+
#### `limit`
102
116
103
117
This parameter limits the number of selected items output by the tag. It works for both the single variable, as well as the tag pair.
104
118
105
-
###Markup Parameter
119
+
#### `markup`
106
120
107
121
When allowing for multiple selections, a single tag will display a comma separated list of values. If you want an HTML list, you can use markup="ul" or markup="ol" to change the output to the equivalent html list
108
122
@@ -116,7 +130,7 @@ Which will render as
116
130
<li>Orange</li>
117
131
</ul>
118
132
119
-
###Backspace Parameter
133
+
#### `backspace`
120
134
121
135
Backspacing removes characters (including spaces and line breaks) from the last iteration of the loop when using a variable pair. For example, if you put a `<br>` tag after each item you'll have this
0 commit comments