netstorage_media
Introduction
The NetStorage Media module facilitates the seamless integration of Akamai NetStorage with Drupal. It empowers you to manage assets stored in NetStorage as native Drupal Media entities.
Key features include:
- Manual Creation: Create media entities by specifying the NetStorage path.
- Automated Synchronization: Sync assets from Akamai NetStorage to Drupal automatically.
Requirements
- drupal/media
- nkmani/netstorage-cms-api
Installation
Install as you would normally install a contributed Drupal module. Visit Installing Modules for further information.
Configuration
- Configure NetStorage credentials by visiting /admin/config/media/netstorage-media, by providing the following details:
- Key
- Domain Prefix
- Upload Account ID
- CP Code
- URL Prefix
- Configure media types
- Add a new media type with source as Akamai NetStorage (/admin/structure/media/add)
- Add a new field with source information (if one is not available)
- In field mapping, map the Filename to Name
- In "Manage form display", set the field widget for the chosen media field to "NetStorage Path"
- In "Manage display", set the field formatter for the chosen media field to "NetStorage Path"
- Save the media type
- Configure sync settings (/admin/config/media/netstorage-media) after creating the media type
- Enable sync
- Configure base directory
- Configure extensions
- Configure media type
- Configure sync media author uid
- Run cron to sync assets
- The media entities created manually or via sync can be used in the same way as other media entities in content types.
Security
NetStorage API key is an important credential and should be handled with care. The key module is used to store the key in a secure manner.
Other credentials like upload_account_id, domain_prefix, cp_code can be left empty, if they are overridden in the settings.php file. It is highly recommended to override this setting in your settings.php file so it is not committed to your repository.
Example settings.php override:
$config['netstorage_media.settings']['upload_account_id'] = 'YOUR_UPLOAD_ACCOUNT_ID';
$config['netstorage_media.settings']['domain_prefix'] = 'YOUR_DOMAIN_PREFIX';
$config['netstorage_media.settings']['cp_code'] = 'YOUR_CP_CODE';
$config['netstorage_media.settings']['url_prefix'] = 'YOUR_URL_PREFIX';
Maintainers
Current maintainers:
- Nagarajan Kalaimani (nkmani) - https://www.drupal.org/u/nkmani