Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions docs/fieldtypes/checkboxes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

[TOC]

Checkboxes allow publishers to choose multiple items from a list.
Checkboxes allow publishers to choose multiple items from a list.

![multiselect field](_images/cp-field-multiselect.png)

Expand Down Expand Up @@ -49,7 +49,7 @@ You can use a single variable for Checkboxes to render a comma-separated list of

### Variable Pair

Using a variable pair, allows for customization of the output.
Using a variable pair of field name, allows for customization of the output.

{field_name}
{item}<br>
Expand All @@ -63,7 +63,18 @@ Two
Three
```

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:
The following variables are available inside field's tags pair:

| Variable | Description |
| --------------- | --------------------------------------------------- |
| `{item}` | Label of selected item |
| `{item:label}` | Label of selected item |
| `{item:value}` | Value of selected item |
| `{count}` | Counter for each of selected items, starting with 1 |
| `{index}` | Counter for each of selected items, starting with 0 |
| `{total_items}` | Total number of selected items |

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:

{field_name}
Value: {item}<br> {!-- 1 --}
Expand All @@ -88,17 +99,19 @@ Given that the selection option is 2/Two:

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.

TIP: **Tip:** Checkboxes, Multiselect and Selectable Buttons all default to showing the label. Radio Buttons and Selects default to showing the value.
TIP: **Tip:** Checkboxes, Multiselect and Selectable Buttons all default to showing the label. Radio Buttons and Selects default to showing the value.

### Parameters

### Limit Parameter
#### `limit`

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.

```
{field_name limit="2"} {!-- One,Two --}
```

### Markup Parameter
#### `markup`

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

Expand All @@ -112,7 +125,7 @@ Which will render as
<li>Orange</li>
</ul>

### Backspace Parameter
#### `backspace`

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

Expand Down
26 changes: 20 additions & 6 deletions docs/fieldtypes/multiselect.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

[TOC]

Multi Select Fields allow publishers to choose multiple items from a list.
Multi Select Fields allow publishers to choose multiple items from a list.

![multiselect field](_images/cp-field-multiselect.png)

Expand Down Expand Up @@ -63,7 +63,19 @@ Two
Three
```

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:

The following variables are available inside field's tags pair:

| Variable | Description |
| --------------- | --------------------------------------------------- |
| `{item}` | Label of selected item |
| `{item:label}` | Label of selected item |
| `{item:value}` | Value of selected item |
| `{count}` | Counter for each of selected items, starting with 1 |
| `{index}` | Counter for each of selected items, starting with 0 |
| `{total_items}` | Total number of selected items |

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:

{field_name}
Value: {item}<br> {!-- One --}
Expand All @@ -88,17 +100,19 @@ Given that the selection option is 2/Two:

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.

TIP: **Tip:** Checkboxes, Multiselect and Selectable Buttons all default to showing the label. Radio Buttons and Selects default to showing the value.
TIP: **Tip:** Checkboxes, Multiselect and Selectable Buttons all default to showing the label. Radio Buttons and Selects default to showing the value.

### Parameters

### Limit Parameter
#### `limit`

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.

```
{field_name limit="2"} {!-- One,Two --}
```

### Markup Parameter
#### `markup`

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

Expand All @@ -112,7 +126,7 @@ Which will render as
<li>Orange</li>
</ul>

### Backspace Parameter
#### `backspace`

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

Expand Down
22 changes: 18 additions & 4 deletions docs/fieldtypes/selectable-buttons.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,19 @@ When allowing multiple items to be selected, Selectable Buttons will usually be
{item}<br>
{/field_name}

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:

The following variables are available inside field's tags pair:

| Variable | Description |
| --------------- | --------------------------------------------------- |
| `{item}` | Label of selected item |
| `{item:label}` | Label of selected item |
| `{item:value}` | Value of selected item |
| `{count}` | Counter for each of selected items, starting with 1 |
| `{index}` | Counter for each of selected items, starting with 0 |
| `{total_items}` | Total number of selected items |

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:

{field_name}
Value: {item}<br>
Expand Down Expand Up @@ -98,11 +110,13 @@ TIP: **Tip:** Checkboxes, Multiselect and Selectable Buttons all default to show

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}`

### Limit Parameter
### Parameters

#### `limit`

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.

### Markup Parameter
#### `markup`

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

Expand All @@ -116,7 +130,7 @@ Which will render as
<li>Orange</li>
</ul>

### Backspace Parameter
#### `backspace`

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

Expand Down