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
|`field_type`| required, validateIsCompatibleWithPreviousValue, enum[checkboxes, colorpicker, date, duration, email_address , file, file_grid, fluid_field, grid, multi_select, notes, radio, range_slider, relationship, rte, select, selectable_buttons, slider, text, textarea, toggle, url] (or the name of a custom field type)||validateIsCompatibleWithPreviousValue is used when modifying the field_type of an existing field. Please see [Fieldtype Compatibility Options](../addon-setup-php-file.md#fieldtypes) for more details. |
29
+
|`field_order`|| integer ||
30
+
|`field_list_items`| required (can be an empty string) || The simplest of three mutual exclusive ways to populate a list of items is using a string with items separated by line breaks \n. Used with listing field types (Checkboxes, Multi Select, Radio Buttons, Select Dropdown and Selectable Buttons) when field_settings['value_label_pairs'] is not set and 'field_pre_populate' == 'n' (do not populate from channel entries)|
|`field_pre_populate`| enum[y,n,v]| boolString | if 'y' populate a list of items from channel entries. Used in conjunction with the two properties `field_pre_channel_id` and `field_pre_field_id`|
38
+
|`field_pre_channel_id`|| integer ||
39
+
|`field_pre_field_id`|| integer ||
40
+
|`field_ta_rows`|| integer | height of a textarea field in rows |
41
+
|`field_maxl`|| integer | max length of a text input field |
42
+
|`field_required`| enum[y,n]| boolString ||
43
+
|`field_text_direction`| enum[ltr,rtl]|||
44
+
|`field_search`| enum[y,n]| boolString ||
45
+
|`field_is_hidden`| enum[y,n]| boolString ||
46
+
|`field_fmt`|| enum[br,xhtml,none]| used only by some field types, 'br' stands for auto line break |
|`field_settings`|| base64Serialized | Specific settings depending on the field type. See the following table. |
50
+
|`legacy_field_data`|| boolString ||
51
+
52
+
## Field settings
53
+
54
+
The property `field_settings` consists in an array of settings that depend on the field type. Here are the most common settings for the standard field types. field settings are stored in the database column 'field_settings' as a base64 encoded string of the serialized array.
55
+
56
+
| Field types | Setting name | Values | Description |
| Rich text editor |`toolset_id`| integer | see Rich Text Editor addon for details, for a standard installation: 1 CKEditor Basic, 2 CKEditor Full, 3 Redactor Basic, 4 Redactor Full |
90
+
| Rich text editor |`defer`| enum[y,n]| Defer Editor initialization |
91
+
| Rich text editor, Textarea |`db_column_type`| enum[text,mediumtext]| Column type in database: TEXT(64Kb) MEDIUMTEXT(16Mb) |
92
+
| Rich text editor |`field_wide`| bool | default true, full width |
93
+
| Rich text editor |`field_show_fmt`| enum[y,n]| default 'n' |
94
+
| Text input |`field_maxl`| integer | Maximum characters |
95
+
| Text input, Textarea |`field_show_smileys`| enum[y,n]||
96
+
| Text input, Textarea |`field_show_file_selector`| enum[y,n]||
| URL |`allowed_url_schemes`| array | example ['http://','https://']|
100
+
| URL |`url_scheme_placeholder`|| example 'http://' |
32
101
33
-
-`field_id` Key
34
-
-`field_instructions`
35
-
-`field_pre_populate`
36
-
-`field_pre_channel_id`
37
-
-`field_pre_field_id`
38
-
-`field_ta_rows`
39
-
-`field_maxl`
40
-
-`field_required`
41
-
-`field_text_direction`
42
-
-`field_search`
43
-
-`field_is_hidden`
44
-
-`field_fmt`
45
-
-`field_show_fmt`
46
-
-`field_content_type`
47
-
-`field_settings`
48
-
-`legacy_field_data`
49
102
50
103
## Relationships
51
104
@@ -60,7 +113,7 @@ lang: php
60
113
-`getContentType`
61
114
-`getSettingsValues`
62
115
-`getAllChannels`
63
-
-`validateNameIsNotReserved`
116
+
-`validateNameIsNotReserved` the list of reserved words is in /ee/legacy/libraries/Cp.php: invalid_custom_field_names()
64
117
-`validateIsCompatibleWithPreviousValue`
65
118
66
119
## Events
@@ -164,3 +217,84 @@ if ($result->isValid())
164
217
$field->save();
165
218
}
166
219
```
220
+
221
+
### Populate a field compatible with list field types
222
+
223
+
For fields like Checkboxes, Multi Select, Radio Buttons, Select Dropdown and Selectable Buttons there are three ways to populate their options: value-labels pairs, manually or from other channel.
0 commit comments