How to add a dropzone to specific admin page

Hi,
I’m working in a theme and I added some modules to the modular page (based on antimatter).

Editing the blueprint files, I manage to adapt the admin interface to my needs, but I didn’t find the way to add a drozone or a file input.

Someone know a way ?

Thanks :slight_smile:

A way to upload files is something we plan on adding to the form plugin. The dropzone field that is used in the admin is very specific for page content media.

Thanks.

I’m trying to use the media on the features module. To do a “Team” module with name and photo.

At moment I use simply a text form with the image name (the image need to be dropped on the media dropzone).

Did there is a way to select (with a select input) for a media collection ?

Currently no as we anticipate this to be handled with an image/media/upload field.

You could write a custom field that did that easily enough though. There are plenty of select type fields throughout Grav that get their selection options from a method. If you look at this example in the system.yaml blueprint:

                timezone:
                    type: select
                    label: PLUGIN_ADMIN.TIMEZONE
                    size: medium
                    classes: fancy
                    help: PLUGIN_ADMIN.TIMEZONE_HELP
                    '@data-options': '\Grav\Common\Utils::timezones'
                    default: ''
                    options:
                        '': 'Default (Server Timezone)'

YOu see this is simply calling a static method on the Utils class to return an array of values. You could either via plugin or theme add a static method that could return the media associated with a page.

Thanks @rhukster !

I will try this.