Wedia Drupal Content Picker

The Wedia Drupal Content Picker is a module for Drupal, compatible with Drupal versions 9 and 10, designed to facilitate integration between your Wedia Digital Asset Management (DAM) and your Drupal Content Management System (CMS).

With the Drupal Wedia module, you can easily:

  • Create new Wedia Image, Wedia Video, and Wedia Asset fields that can be seamlessly added to your Drupal content types.

  • Select assets from your Wedia DAM library using a variety of search features, including filters, full-text search, and board lists.

  • Enjoy support for Drupal Image styles, which allows you to customize the display of your images according to your specific needs.

  • Crop images within Drupal using the Wedia Drupal module’s built-in support for image cropping.

  • Support token based video digital right protection.

 

All images and videos are streamed inserted into Drupal are streamed for the Wedia DAM, avoiding content duplication, and right management issues. The Wedia DAM also collects analytics data to report how your images and videos are performing as marketing assets on your website.

 

Installing the Wedia Drupal Content Picker

The module is available here : https://www.drupal.org/project/wedia

Installation Procedure for the Module:

Method 1: Using Composer (recommended)

  • Connect to your Drupal server via SSH.

  • Launch the following command at the root of your Drupal project:

composer require 'drupal/wedia:^1.0'

  • Go to the default site folder (or another folder if using a multi-site configuration):

  • cd web/sites/default

  • Activate the module:

drush en wedia

(OR, if Drush is not installed globally on the server)

../../../vendor/bin/drush en wedia

Method 2: ZIP and FTP (wedia.zip)

  • Download the package archive from the module release page:

(change the version from 1.0.0 to the latest available version)

[ZIP] → https://ftp.drupal.org/files/projects/wedia-1.0.0.zip

[TAR.GZ] → https://ftp.drupal.org/files/projects/wedia-1.0.0.tar.gz

  • Decompress the archive.

  • Connect to the Drupal server via FTP or SFTP.

  • Upload the module folder to the "web/modules/custom" or "modules/custom" folder, depending on the initial Drupal installation.

  • Log in to the Drupal back office (/user/login).

  • Go to the modules page (/admin/modules).

  • Check the "Wedia" module box.

  • Click "Install" at the bottom of the page.

Updating the Wedia module to the latest version

When a new version is released, you can upgrade to the latest version by using the following command:

You can update the module with the following command:

composer update

Then, clear Drupal's caches using the command:

drush cr

 

Licensing the Wedia Content Picker users.

Out of the box, no user has the privilege to use the Wedia Content Picker. To gain access, kindly get in touch with your Wedia account manager and obtain a license for the content picker.

Settings for the Wedia Drupal module

Settings the Wedia Drupal module are available in the dedicated section in the Drupal Configuration:

Setting the Wedia Server

The URL of the Wedia server your are connecting to is mandatory. It defaults to our demo website.

 

Configuring the Wedia user interface for the content picker

Some user interface elements of the Wedia Content Picker can be deactivated for a streamlined experience:

 

Setting the analytics tracking behaviour for video

DNT is a privacy feature that stands for “do not track”. It is supported by Wedia to enable or disable the very precise analytics on video playing gathered by the Wedia video player.

To enable or disable tracking behaviour for video analytics, you can customize this feature on a per-embed basis by adding "&dnt=true" or “&dnt=false” to the video's embed code, in the query string.

By default, for a better user privacy, we disable tracking for all videos by adding "dnt=true" to every embedded video.

If you have installed a GDPR cookie banner on your Drupal website and are using a "per user" choice to manage this parameter on pages where the video is displayed, you can disable this default option and manually control the "dnt" parameter.

Setting up token based video protection

If you have enabled on your DAM the toke based video protection, you need to add the secret code provided by Wedia and the duration of the validity of the generated token. If you leave these parameters blank, token based protection will be disabled.

Setting up the size of the images in the CK Editor text field

The Wedia Content Picker can be used to insert images into a HTML field managed, edited by CK Editor.

In that case, multiple behaviours are available for the image size :

  • Let the template/theme manage the image dimensions : images will be inserted without information about the height and width. This can be useful if the Drupal theme takes over the rendering and forces the image sizes, by passing size info into the rendered IMG SRC value. The Wedia Digital Transformation API support multiple parameters :

[SERVER BASE URL]/api/wedia/dam/transform/[UUID]/[BASE VARIATION]/[FILE_NAME][.FILE_EXTENSION]/t=[TRANSFORMATION]&[CROP PARAMETERS x=XPct&y=YPct&width=widthPct&height=heightPct&fx=x&fy=y]&outputWidth=[OUTPUT_WIDTH]&outputHeight=[OUTPUT_HEIGHT]

Please read https://crossmedia.atlassian.net/wiki/spaces/WD/pages/379551745/Wedia+Content+Picker#Processing-the-information-returned-by-the-Content-Picker-for-Images for a better understanding of these parameters.

  • Let the template/theme manage the image dimensions as previously, but prompt the user choosing the image to select a focus point, that can be used when resizing the image to keep the image in focus.

  • Force the user to crop the image to a designed height and width.

Setting the SEO keywords behaviour in the generated image SRC

In the SEO world, the image name in the IMG SRC can add context for a better search engine indexation.

The Wedia Content Picker can add keywords separated by a hyphen to the file name, as the filename can be arbitrary using the Wedia Digital Transformation API.

The default metadata added to the file names are coming from the “keyword” property, which is the default setup.

If you have set up your content picker to return other metadata in the returned JSON, you can use the returned properties to build your SEO filename.

Changing the default variation name

It allows starting the transformation based on a given variation. Usually, this parameter is empty, and the transformation always starts from the best variation. The best practice is to omit this parameter and let the system choose the best one, but if you would like to benefit from a variation that has its background removed by an AI, then the BASE VARIATION should be set to "stripped_background", that is the variation of the image that was processed by AI to try to remove the background to isolate the subject on a transparent background.

To better understand base variations : https://crossmedia.atlassian.net/wiki/spaces/WD/pages/2117828611/Digital+Asset+Transformations+and+Delivery+API#Using-a-built-in-variation

Setting up the permissions to update the Wedia module settings

The Wedia module settings can be set up by user roles set up by the Drupal permissions system:

The default setup grants administration rights to the Administrator role.

Available new fields types

The Wedia module adds 3 new fields type:

  • Wedia Image

  • Wedia Video

  • Wedia Asset

The Wedia Image is used when adding one or many images to a content types.

The Wedia Video is used when adding one or many videos to a content types.

The Wedia Asset is more generic, it does not filter on the asset nature, image, video, 3D, document… when picking the asset.

Wedia fields can be added to any Drupal content type, as any other field :

Inserting images in a Drupal Content

When a Drupal content type has been defined with a “Wedia Image” field, the content form includes the new image field to allow the content author to add an image from the Wedia DAM:

Tip : When setting up your content type, and adding your field to the content type, you can set up default values in the content picker options.

To select an image, click on “Select image in the Wedia DAM”, this will open the Wedia DAM as an overlay of the current page. You can click on the top red cross to close this overlay and return to the previous state.

You may need to log in into the Wedia DAM. Single sign-on for most of the SAMLv2 and oAuth2 authentication system will work, but this may require some testing.

When logged, you can use the Wedia DAM to search for images. All other asset type will be filtered.

Please note that depending on the module setup, some of the user interface may not appear : filters, sort, universes marked in yellow below:

When hovering on the selected image, the “integrate” button will let you select the image and insert its reference into the Drupal content. The image is not copied into media library of Drupal, only its references are stored, and the image field will be linked to the Wedia content.

Once inserted, the ALT text is filled, depending on the name coming from the DAM. The language of the name depends on the language of the Drupal content:

To reset a Wedia image field, use the Clear button:

 

To render the image in the final website, the page template of the theme can use the Image styles provided by Drupal, the Wedia modules support image styles.

Inserting videos in a Drupal Content

The video uses the same logic as for the Wedia image:

But when the content picker opens, only videos will be available for picking:

The poster image is defined into the Wedia DAM.

The player size can use preset sizes, or use the last option to define a per content custom size: