Skip to content

Commit e1f1d70

Browse files
authored
Merge pull request #475 from marcorensch/patch-2
Update status.md
2 parents 3db4ea2 + da4a359 commit e1f1d70

File tree

1 file changed

+28
-6
lines changed
  • docs/general-concepts/forms-fields/standard-fields

1 file changed

+28
-6
lines changed

docs/general-concepts/forms-fields/standard-fields/status.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ The **status** form field type provides a list box of statuses. This field exten
1111
- **description** (optional) (translatable) is the [field description](../standard-form-field-attributes.md#description).
1212
- **multiple** (optional) if set to true allows multiple items to be selected at the same time. Set to false to allow single selection.
1313
- **required** (optional) if set to true, the first field option should be empty, see last example.
14+
- **optionsFilter** (optional) Comma-separated list of values to be displayed.
15+
- **class** (optional) add the classname `form-select-color-state` to add color feedback for the selected state.
1416

1517
Implemented by: libraries/src/Form/Field/StatusField.php
1618

@@ -25,9 +27,29 @@ Implemented by: libraries/src/Form/Field/StatusField.php
2527
/>
2628
```
2729

28-
Based on the source code this returns the following entries in a list:
29-
Trashed - JTRASHED
30-
Disabled - JDISABLED
31-
Enabled - JENABLED
32-
Archived - JARCHIVED
33-
All - JALL
30+
## Available options
31+
Based on the source code this returns the following entries in a list:
32+
33+
| Value | Text |
34+
| ----- | ------------ |
35+
| -2 | JTRASHED |
36+
| 0 | JUNPUBLISHED |
37+
| 1 | JPUBLISHED |
38+
| 2 | JARCHIVED |
39+
| * | JALL |
40+
41+
## Filter options
42+
If this field is used in the element context and not as a filter, the *All* option is not required, for example.
43+
In such a case, the **optionsFilter** attribute can be used to select which options should be selectable.
44+
45+
```xml
46+
<field
47+
name="mystatus"
48+
type="status"
49+
label="Choose"
50+
description=""
51+
optionsFilter="0,1"
52+
/>
53+
```
54+
55+
The field now only loads the options JPUBLISHED and JUNPUBLISHED.

0 commit comments

Comments
 (0)