Tailwind Logo

Drupal and Sitecore Content Hub - DAM integration

Digital Asset Management

Published: 2020-12-16

A sample Sitecore Content Hub and Drupal integration is available for testing. In this article, we will introduce how the integration works.

Sitecore Content Hub integration review

For Sitecore Content Hub DAM, integration with the Sitecore Experience Platform (CMS) is provided through a connector. This connector allows users to specify images from the Sitecore CMS administration screen without having to switch tools.

This mechanism is based on a connector provided by Sitecore, but it can be used with other CMSs as well.

Sample integration with Drupal

A connector for integration with Drupal is available for Sitecore Content Hub 3.2.1.

The prerequisite for using this is Drupal 8.x (a different connector is required for Drupal 9.x). In this article, we will install and run Drupal, install and configure the connector to work with the Sitecore Content Hub.

Preparing for Drupal 8

Installing XAMPP

In order to install Drupal 8 quickly, we will proceed with the setup in an environment where Chocoletey is already installed. First, with PowerShell administrator privileges, execute the following commands.

PowerShell
choco install bitnami-xampp
xamppinstall.gif

XAMPP is a tool that allows you to easily set up an environment not only for Drupal, but also for Wordpress and other applications. When the installation is complete, a tool called XAMPP Control Panel will be installed. The following is the screen when the tool is started with administrator rights.

xamppapp.png

Of the tools listed in the control panel, we will be using Apache and MySQL. Click on the "Start" button to start either of them.

xamppapp2.png

XAMPP is now ready. If you try accessing http://localhost/ you will see the following screen.

welcomexampp.png

Drupal 8.x file copy

To install Drupal 8.9.11 this time, download the zip file, after extracting it, copy it to c:¥xampp¥htdocs.

copydrupal.png

MySQL Server Configuration

Next we will prepare an empty MySQL database for Drupal to use. Clicking on it will take you to the administration screen.

xamppapp2.png

The management screen that opens is shown below.

phpmyadmin.png

Click on Database in the menu to go to the Create Database screen.

createdatabase.png

In this case, we have created a database named drupaldemo.

drupaldemo.png

Once created, if the drupaldemo database appears on the left side, the database is ready.

drupaldemo2.png

Installing Drupal

After completing the above settings, access http://localhost/drupal/ and you will see the configuration screen, where the URL is the Drupal folder name as it was when you copied it under htdoc (in this case, already created in Drupal). The following screen first displays the language confirmation.

drupal1.png

Select Japanese this time and move to the next screen. The next screen will be the installation profile selection. Select Standard.

drupal2.png

Verification of requirements will be displayed. The following screen recommends PHP OPcode caching, but since this is a verification environment, we will proceed without much concern. Select "Proceed for now" at the bottom of the page.

drupal3.png

You will then be prompted to configure the database. Specify the database you just created (drupaldemo) and the user name (root). Since this is a verification environment, the database user is root and the password is left blank since it is not set by default.

drupal4.png

A short time after clicking, installation will begin.

drupal5.png

Site environment settings will appear as post-installation settings.

drupal6.png

The setup is completed by putting in the necessary items such as user name and password. The environment after installation is as follows

drupal7.png

A clean installation of Drupal is ready. Next, we will install the connectors.

Connector installation and configuration

Install

As for connectors, they can be downloaded from the Sitecore Content Hub site.

You can download the zip file by clicking on the Drupal Connector link on the page as shown below.

drupalconnector1.png

After unzipping the file, you will find two zip files as follows

drupalconnector2.png

For example, if you expand libraries.zip, you will see that it contains two folders as follows

drupalconnector3.png

Copy this folder to the folder where Drupal is installed.

drupalconnector4.png

Similarly, copy the files in modules.

drupalconnector5.png

After copying the modules, activate them in the Drupal environment: log in to Drupal, select Extensions, and make sure that the two modules are ready in the Custom section.

drupalconnector6.png

Check the two items and click Install at the bottom of the page to complete installation of the module.

drupalconnector7.png

Once the module installation is complete, the rest is additional configuration.

Settings

In the Drupal administration page, click on Preferences and select Text Format and Editor.

drupalsetting1.png

Add any additional Sitecore icons to the Basic HTML and Full HTML. Uncheck the Restrict to images on this site checkbox to enable the display of Sitecore Content Hub images.

Next, open MConnector Settings in Development Settings.

drupalsetting2.png

As for the configuration, you will be prompted to set the instance and URL of the Sitecore Content Hub.

drupalsetting3.png

The URL varies depending on the version of Sitecore, but for the Sitecore Content Hub 3.3.4 tested this time, the URL is entered as follows

Plain Text
https://sitecore-content-hub/ja-jp/sitecore-dam-connect/approved-assets

This completes the Drupal configuration.

Configure Sitecore Content Hub

In order for the prepared server to be able to work with the Sitecore Content Hub, a hostname must be added to the CORSConfiguration. In this case, we will add https://localhost.

  1. From the administration screen, select Settings
  2. Select CORSConfiguration, which is the advanced setting for PortalConfiguration
  3. Add https://localhost
  4. Save.

In this case, we are using localhost because this is a test environment.

contenthubcors.gif

Confirmation of operation

To check the operation, proceed as follows

  1. Log in to Sitecore Content Hub (you can do this after logging in to Drupal)
  2. Access to https://localhost/drupal/
  3. Log in to Drupal
  4. Click Content
  5. Click Add Content
  6. Click on an article
  7. We will write the article. When selecting images, click on the Sitecore icon and make sure you can specify Content Hub assets
  8. Save
  9. You can see the Sitecore Content Hub assets configured in the article
drupalwithchdam.gif

Summary

Sitecore Content Hub - This allows users to select assets provided by DAM directly from the CMS and use them as images on their websites. This allows you to use images and other assets on your website without the need to copy DAM data into the CMS. In fact, we provide integration with the Salesforce Marketing Cloud in the same way.

Tags