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
If your add-on requires a particular version of ExpressionEngine, or a minimum version of PHP, adding `requires` to your addon.setup.php will check for minimum versions of the specified framework, and will stop installation if the minimum requirement is not meant.
247
+
239
248
## Accessing Add-On Information From Another Add-on
240
249
See the [Addon Service](development/services/addon.md) for API access.
|`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](development//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.
Models can be related to other models using just a little bit of metadata. They are defined on a `$_relationships` metadata array. The array keys should be the relationship names, and their values will be a description of the relationship:
132
132
@@ -195,7 +195,7 @@ Validation rules are added using the same format as the [Validation Service](dev
195
195
You can also create your own local validation rules. These one-off rules can be added directly to the model class by creating a public method whose name starts with `validate`. The method will be treated as a [custom validation rule](development/services/validation.md#custom-rules). On validation it will receive the property name, current value, rule parameters, and the rule object. The method should return `TRUE` on success, and an error string or language key on failure:
Copy file name to clipboardExpand all lines: docs/installation/best-practices.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
16
16
ExpressionEngine's system files and directories are typically safe from direct HTTP access on a properly configured server.
17
17
18
-
However, for increased security we recommend that the `system` folder either be renamed or moved entirely above the public web root folder (commonly named public_html or referred to as simply "webroot") and that admin.php be renamed as well. This document describes the renaming process.
18
+
However, for increased security, we recommend that the `system` folder either be renamed or moved entirely above the public web root folder (commonly named `public_html` or referred to as simply "webroot") and that `admin.php` be renamed as well. This document describes the renaming process.
0 commit comments