Media source plugin settings
Media gallery settings components
This guide explains all of the media gallery settings componenets that are available to be used in your plugin’s settings JSON configuration, giving your app users the ability to find the media they want to add into their email content.
Search
The optional search functionality utilizes “type”: “text”
to offer a way for creators to filter your images through a text filter.
It is good practice to make this as smart as possible - ensuring that you return the elements that make sense with the text inputted by the user. This means matching against the name of the image, but also any other relevant metadata a creator may be filtering by (e.g. you may want to include the name of the Folder within the search logic).
Upon keystroke, a new POST request will be made to the request URL
specified, with the text inputted, for your app to return a newly sorted version of results.
Filter
The optional filter functionality allows plugins to offer a flat, single-select dropdown the creator can select from to help them find the content they are looking for. This can be predefined through use of the select input
or programmatically generated as the plugin loads, through use of the dynamic select input
.
Select Input
The optional filter functionality utilizes “type”: “select”
to offer a flat list of pre-defined filter options the creator can select from, each with a label
and value
nested in an options
array. Currently, only single-select functionality is available here. Once an option is selected, a new POST request will be made to the request URL
specified, with the value selected, for your app to return a newly sorted version of results.
Dynamic Select Input
The optional dynamic filter functionality utilizes “type”: “dynamicSelect”
to offer a flat list of dynamic filter options the creator can select from. For this, we will make a request to a POST endpoint you have created on your server to return the elements for the filter select menu as soon as the plugin is visited within the media gallery.
The response will return an array of options
, each with a label
and value
. Currently, only single-select functionality is available here. Once an option is selected, a new POST request will be made to the request URL
specified, with the value selected, for your app to return a newly sorted version of results.
Sort
The optional sort functionality utilizes “type”: “select”
to offer a flat list of sort options the creator can select from, each with a label
and value
nested in an options
array. Once an option
is selected, a new POST request will be made to the Request URL specified, with the value selected, for your app to return a newly sorted version of results.