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
Copy file name to clipboardExpand all lines: docs/development/fieldtypes/enhanced.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -239,6 +239,16 @@ Possible return values are:
239
239
-`'text'` - shows text input
240
240
-`'select'` - shows select input populated with the field options (for fieldtypes that extend `OptionFieldtype`)
241
241
242
+
## File Manager support
243
+
244
+
References to files (as placed by Filepicker) can be in different forms - contaning file ID (e.g. `{file:123:url}`), or contaning directory ID and file name (e.g. `{filedir_2}filename.jpg`) when in [Compatibility Mode](control-panel/file-manager/file-manager.md#compatibility-mode).
245
+
246
+
To get both cases parsed correctly, please use `ee()->file_field->parse_string` function.
247
+
248
+
ee()->load->library('file_field');
249
+
$data = ee()->file_field->parse_string($data);
250
+
251
+
If you fieldtype is using custom JavaScript for treating the files, be sure to make the code aware of [`EE.fileManagerCompatibilityMode`](development/control-panel-js/globals.md#filemanagercompatibilitymode) variable.
0 commit comments