With the Mediaflow app, editors can retrieve images, videos and other files directly from Mediaflow while working in Contentful. The file is published via the Mediaflow CDN, and its metadata, such as alt text, keywords and photographer, is transferred to Contentful.
What you need
- A Mediaflow account that includes Mediaflow CDN in the agreement. Read more about why in Insert files from Mediaflow in Contentful.
- App login details from Mediaflow: Client ID, Client secret and Refresh token.
- Permission to install apps in the Contentful space where the app will be used, for example as an administrator.
- A content type with at least one field of the JSON object type for each location where editors should be able to select a file from Mediaflow.
You receive the app login details from Mediaflow. Contact Mediaflow before starting the installation.
Prepare the content type
The app saves the file and its metadata in a JSON object field. If the content type already has such a field, you can go straight to the next step.
- Go to Content model and open the content type that will use files from Mediaflow.
- Click Add field and select JSON object.
- Give the field a name, for example Image or Hero image, and click Add and configure and then Confirm.
- Save the content type with Save.
Create one field per file location, for example one for a hero image and one for a video further down the page. Each field can contain one file from Mediaflow.
Install the app from the Marketplace
- Go to Apps in the top menu and select Marketplace.
- Search for Mediaflow and open the app.
- Click Install now.
- Select a space and one or more environments and click Install to selected environments.
- Approve the app's access to your space with Authorize access. You will then be taken to the app's configuration page.
Configure the app
On the App Configuration page, connect the app to your Mediaflow account and select which fields should use Mediaflow.
Enter the login details
Enter the Client ID, Client secret and Refresh token you received from Mediaflow. All three fields must be completed for the app to connect to Mediaflow.
Choose whether links to Mediaflow should be displayed
The Show links to files in Mediaflow setting is enabled by default. It displays a link from the file in Contentful directly to the file in Mediaflow, allowing the editor to quickly complete metadata such as alt text. Turn off the setting if your editors do not have their own accounts in Mediaflow.
Connect the app to the fields
Under Assign to content types, your content types are listed with their JSON object fields.
- Tick the fields that should contain files from Mediaflow.
- Tick Sidebar button to update all Mediaflow fields for the content types where editors should be able to update the metadata for all Mediaflow fields in an entry at once. The button is displayed in the sidebar when the entry is open.
Save and check the connection
Click Install. The app immediately checks the login details against Mediaflow and displays the message Mediaflow authentication successful when everything is ready.
If the check fails, the app is still saved, and you will receive a message saying that the login to Mediaflow was unsuccessful. Correct the details on the same page and click Save again.
Change the settings later
Go to Apps and select Installed apps. Open the Mediaflow app to return to the configuration page. There you can change the login details, connect the app to more fields or change the link setting. Click Save when you are finished. The app does not need to be reinstalled.
Do you use multiple environments, for example one for testing and one for production? The app is installed per environment, so repeat the installation for each environment where editors should be able to retrieve files from Mediaflow.
Security
Client secret and Refresh token are stored as secret parameters in Contentful. They are only displayed on the configuration page and are never sent to editors' browsers. Each request from the app to Mediaflow's server is signed by Contentful and only applies to the space and environment where the app is installed.
Do you suspect that the login details have fallen into the wrong hands? Contact Mediaflow for new details and change them on the app's configuration page.
Next step
The app is now ready to use. Read how editors can insert files from Mediaflow in Contentful.