5 Commits

Author SHA1 Message Date
Matias Griese
4b3c41cc28 Fixed filepicker, pagemediaselect fields with multiple: true and array: true [#1580] 2020-12-01 21:29:51 +02:00
ricardo118
ebd16639dc added on_demand option for filepicker (#1809)
on_demand: true option for filepicker field allows for users to only load the filepicker when the select field is clicked on. This is very useful for pages with many filepickers or large media files, as the page speed improves significantly
2020-01-17 12:29:43 -07:00
Flavio Copes
b2f88bba2e Fix #859 make default value work for filepicker 2016-11-11 18:53:58 +01:00
Djamil Legato
74b756d6a8 Dramatically improved filepicker performance. Data is only ever loaded when the dropdown is on focus, as it was supposed to be. Image preview of a selected item won't be rendered unless the field gains focus to avoid wasting resources. (fixes #788) 2016-10-01 00:09:01 -07:00
Flavio Copes
8a39b36603 Filepicker form field (#750)
# What this PR introduces
This PR introduces a `filepicker` field which is a replacement for the `pagemediaselect` field. 

This field loads the files list via AJAX each time it's triggered. This means you can now upload a file via FTP or via Admin and the new file is immediately available to be selected.

Previously, `pagemediaselect` required a page reload to see the newly added files.
--

### Options

#### `accept`

`accept` allows file extensions. For example, to only allow `yaml` and `json` files:

```yaml
accept:
  - .yaml
  - .json
```

By default, any file is listed.

#### `folder`
```yaml
folder: 'user/plugins/testing`
```

folder has been enhanced to allow `self@` as well as `page@:` and `theme@:` prefixes.
Example of usage, assuming we have a blog item at the route `/blog/ajax-upload` (physical location being `user/pages/02.blog/ajax-upload`), with the `page@:` prefix the folder would be:

```yaml
folder: 'page@:/blog/ajax-upload'
```

#### `preview_images`
```yaml
preview_images: true
```

If enabled, shows a preview for the images file types

> ### NOTE: `self@` is not allowed outside of the Pages scope, an error will be thrown. 


## Example usage


```
            header.a_file:
              type: filepicker
              folder: 'user/plugins/admin'
              label: Select a file
```
2016-09-02 18:29:47 +02:00