The Drupal integration enables images and videos stored in Mediaflow to be published directly in Drupal’s editing interface. A fantastic way for web editors to always have access to files that are GDPR-compliant, have the correct alt text, and videos that are accessible.
Settings in Mediaflow
The Drupal integration can be used as soon as it has been installed. However, for the files to be available and used optimally, administrators must first have prepared the settings for them in Mediaflow.
Install the Drupal integration
The integration is available in Drupal’s module library. You can install it via Composer or by downloading the latest release as a zip file or tar.gz file and uploading it in the module section of your Drupal installation.
Do not forget to activate the module after uploading it.
Mediaflow also depends on the Media and Media Library modules in Drupal, so these must also be activated for the module to work. Finally, the Key add-on module is required to comply with Drupal’s security requirements.
Configure the integration
To configure the module, go to Configuration, and under the Media section you will find Mediaflow.
First, you need to enter the keys required to connect Drupal to Mediaflow.
Client ID and Client Secret are details you received from Mediaflow when you acquired the Drupal integration. If you do not have these details, contact Mediaflow support.
Refresh token can be found in the Mediaflow interface under Settings (the cogwheel in the menu) > Integrations > Drupal.
To increase security in Drupal, Mediaflow uses the Key add-on module, which provides functionality for storing keys in locations other than the database. The keys for Mediaflow are created as instances under the Key module’s settings, and if you have not already created these keys, click the link create a new key.
Enter a name for the key, preferably a description, and paste the copied key value into the Value field. Do this for all three keys – Client ID, Client Secret and Refresh token.
If you select Configuration under Provider settings, the information is saved in the database, but you can choose to save it in other ways, for example in a .env file.
Follow the instructions and recommendations on the Key module’s project page on drupal.org.
Once you have entered the key information in Drupal, you can select these on the Mediaflow settings page, Configuration > Mediaflow.
Can’t see the Client ID and Client Secret fields?If you cannot see fields for these values, you have an older version of the integration and Mediaflow recommends upgrading to the latest version.
Configure CKEditor in Drupal
For the Mediaflow button to appear in CKEditor in Drupal, some settings need to be configured.
Go to Configuration > Text formats and editors.
Here, you need to drag the Mediaflow button into the toolbar where you want the button to be located.
Then click the Mediaflow tab under CKEditor 5 plugin settings and select the media type.
Also make sure that Embed media is checked in CKEditor’s settings. Without this, the images will not be rendered in the editor.
This adds a button in CKEditor where you can use Mediaflow’s file selector to insert images or videos.
Configure the Mediaflow field in Drupal
In addition to working with Mediaflow in the editor, you can also add a field to content types. To do this, go to Structure > Content types and select Manage fields for the content type to which you want to add the field.
In the list of fields, select the type Mediaflow, enter a label and save.
This adds a field where you can click the Pick Mediaflow media button to open Mediaflow’s file selector.