- Requirements
- Installation
- Configuration
- Setting up CDN formatting templates (only for CDN-mode)
- Setting up file usage tracking in Kontainer
Requirements
Module dependencies:
Installation
- Require Kontainer via composer
composer require drupal/kontainer
- Enable the Kontainer module
- via drush
drush en kontainer
- or enable module through module page
Configuration
- Go to /admin/config/media/kontainer
- In "Kontainer URL" add the url of your kontainer, remember "https://"
- In "Preferred media source" choose between using "CDN" and "Media Storage"
- "Save configuration"
CDN (recommended)
"CDN" uses the Kontainer content network to provide images fast and Drupal does not host the media. When using "CDN" you can also setup formatting templates, to match the download templates found in you Kontainer, so images will be output in the correct quality and size.
Media storage
"Media storage" downloads the media to Drupal media library. Here Drupal will host the media, this allows using the build in image styles in Drupal.
Setting up CDN formatting templates (only for CDN-mode)
- Go to /admin/structure/cdn-image-conversion
- Click "Add a CDN image conversion"
- In "Label" put any name, you can identify the formatting template
- In "Kontainer Template ID" go to your Kontainer, go to /source/downloadtemplates and find the ID of the templates you want to use.
- In "Image format" select the output format to match the output extension set in Kontainer
- Check "Enabled"
- "Save"
Setting up file usage tracking in Kontainer
- In section "File usage tracking", click "Copy URL to clipboard"
- Go to your Kontainer, go to /settings/drupal and click "Create new"
- In "URL" insert copied url from Drupal
- In "Name" insert any name to help identify the Drupal integration
- Copy Integraion ID and Integration secret from Kontainer into Drupal
- "Save configuration"
- Go to Kontainer and test connection (If connection fails try to clear cache in Drupal)