Important
EOL notice! Drupal 8 reached end-of-life on November 2, 2021. For more information, see Frequently Asked Questions.
The Media: Acquia DAM (media_acquiadam
) Drupal module provides
unidirectional syncing of media from Acquia DAM Classic to your Drupal 8 or Drupal 9
website.
Before you can use Acquia DAM Classic, you must connect your website to Acquia by installing the Media: Acquia DAM module. This connector module allows your website to exchange information with Acquia DAM Classic.
For information about installing and enabling Drupal modules on your website, see Installing a Drupal 9 module.
If you are upgrading from an older version of the connector module, you must upgrade your database by running the following command:
drush updatedb
Notes
To connect to Acquia DAM Classic:
Sign in to your Drupal website as a user with Administrator permissions.
In the top menu, click Configuration.
Scroll to the Media section and click Acquia DAM.
In the Authentication details section, enter your Username, Password, Client ID, and Client secret.
Notes
To use the regular sync method, follow the steps in Using the regular sync method. Alternatively, use the notification-based sync method.
Click Save configuration.
The regular sync method:
When the end of the queue is reached, all DAM-synced media entities are requeued and the process continues.
The regular sync method is the default sync process and is used unless the Enable notifications-based synchronization option is selected in the module configuration form.
Note
You can configure cron as required to ensure that the sync process works as expected. For more information on scheduled jobs, see the Scheduled jobs section.
To use the regular Drupal sync method:
Perform the steps mentioned in Connecting to Acquia DAM Classic.
In the Cron settings section, select how frequently your cron job will sync your metadata and assets between your Drupal instance and your Acquia DAM Classic account. The default value is Every hour.
If you have multiple assets, frequent synchronization can ensure timely update of assets. To update the cron interval:
Set the Cron settings to Every cron run
.
Create a Drupal scheduled job
to run media_acquiadam_asset_refresh
more often than Drupal cron is
set to run. For example, every five minutes or every two minutes.
To run the queue more frequently, add the following Drush command to the cron job:
drush queue-run media_acquiadam_asset_refresh
Important
You might hit an API request limit, resulting in assets not syncing as expected due to one of the following:
media_acquiadam_asset_refresh
runs
multiple times concurrently, .If you encounter an invalid_grant
error, ensure that you specify the
correct Username, Password, Client ID, and Client secret.
Notifications-based sync is an alternative method that adds an item to the sync queue only when a change is made to the asset in DAM. This reduces the size of the queue, and therefore makes the sync process more efficient.
Note
Log in to your Acquia DAM Classic instance as the sync user.
Click the bell icon at the bottom right.
Click View all.
The system displays the Notifications window.
Click Change settings.
The system displays the Notifications Settings pop-up window.
Select the Watch all assets checkbox.
Save the changes.
Sign in to your Drupal website and navigate to /config/media/acquiadam
.
Select the Enable notification-based synchronization checkbox.
Important
Out of the box, the tasks to queue items and sync the next batch of items run when Drupal cron runs. You can set the asset refresh interval in the module settings form to run Every time cron runs or at another interval.
This might be adequate for a site with a limited number of assets to sync, or a site where Drupal cron runs very frequently. However, for sites with a lot of assets to sync or a site that needs to sync assets more often, you can tune the sync process through a combination of:
Example:
media_acquiadam
asset refresh every five minutes,
except at the top of the hour.As a result of these steps, a batch of assets is checked or synced every five minutes. Hence, the changes in DAM reflect in Drupal faster.
After you have connected your website to Acquia DAM Classic, you must configure a new media type, an Entity Browser, and add a reference field to your preferred content type.
Acquia recommends configuring private file storage for your website, since Acquia DAM Classic asset files download locally when added to a piece of content.
The Media: Acquia DAM - Example Configuration module provides a couple of pre-configured Media Types to help kickstart the configuration process if necessary.
To use Acquia DAM Classic assets in content, add a Media Type entry:
Asset
.jpg gif png svg pdf doc docx
ppt pptx xls xlsx mp4 mpg mpeg webm
.Note
The Acquia DAM connector module replaces files on sync. Therefore, you must set File directory to a directory exclusive for DAM assets.
To access your Acquia DAM Classic assets from the WYSIWYG editor, configure an Entity browser for your Acquia DAM Classic assets using the Acquia DAM Classic widget plugin:
Acquia Dam Classic Entity Browser
.Modal
. (This is the default.)To configure the number of items per page in the Entity Browser, navigate
to Configuration > Media > Acquia DAM
(URL path: /admin/config/media/acquiadam
).
Use the Entity Browser module to remotely browse DAM through Drupal, provided the module is installed and configured.
Select the Entity Browser module.
The Entity Browser module automatically creates assets locally, but requires additional configuration including the Entity Browser widget.
On forms, configure the entity reference fields to use the newly configured Entity Browser.
Authenticate to DAM through the media to access DAM Assets.
After the configuration, Entity Browser displays all DAM assets that the current user can access and utilize. The following screen displays the folders containing DAM assets:
Once added through a piece of content, DAM assets appear on the Media content admin page like any other Media asset in Drupal.
To add a content type field for your chosen content type:
Acquia DAM Classic asset
.Note
To access your Acquia DAM Classic assets from the WYSIWYG editor, configure an Entity browser for your Acquia DAM Classic assets.
To update the form display to include the field you added for your chosen content type:
To update the content type display to include the field you added for your chosen content type:
Notes
The Entity Embed module is required for the next steps.
/admin/config/content/embed
).Acquia DAM Classic
.Entity
.Media
.Sign in to your Drupal website as a user with Administrator permissions.
Navigate to Configuration > Content authoring > Text formats and editors (URL path: /admin/config/content/formats
).
In Basic HTML, select Configure.
In Toolbar Configuration, drag and drop the button configured for the Acquia DAM button to the Active Toolbar.
In Enabled filters, select the Display embedded entities checkbox.
In Filter settings, ensure the following text is displayed in Allowed HTML tags:
<drupal-entity data-entity-type data-entity-uuid data-entity-embed-display data-entity-embed-display-settings data-align data-caption data-embed-button>
By default, it displays as the last line.
Click Save configuration.
After completing these steps, Drupal content authors can click the button in the WYSIWYG editor to access the Acquia DAM Classic entity browser.
You can add assets to Drupal from Acquia DAM Classic using Drupal entities or the WYSIWYG editor.
To add assets using Drupal entities:
Sign in to your Drupal website as a user with content creation permissions.
Navigate to Content > Add new content.
Select a content type to add.
To select an asset, click Select entities.
The entity browser is displayed.
Click a folder to view the assets inside it.
Click an asset, and click Select assets.
This imports the assets into Drupal.
To add an asset using the WYSIWYG editor:
Sign in to your Drupal website as a user with content creation permissions.
Navigate to Content > Add new content.
Select a content type to add.
Click the WYSIWYG button.
The entity browser is displayed.
Click a folder to view the assets inside it.
Click an asset, and click Select assets.
Select values to choose how your content must be displayed:
Click Embed.