Cloudinary External DAM module
The Cloudinary External DAM module lets you connect to Magnolia with Cloudinary. It consists of the Cloudinary DAM Connector and the Cloudinary Media Widget Integration module.
The Cloudinary DAM Connector module provides a connector to Cloudinary to use assets form this service. It provides an app to browse and manage assets, and a dialog to use these assets in your website.
The Cloudinary Media Widget Integration module lets you integrate Cloudinary asset management directly into your dialogs and apps. With this widget, you can select, upload, and even remove assets from within a dialog.
This project exposes the cloudinaryWidgetField field.
This field is used as a replacement for the Cloudinary damLinkfield to select assets from your Cloudinary account.
|
|
This module is at the INCUBATOR level. The |
Installing with Maven
Maven is the easiest way to install the module. Add the following to your bundle:
| You must have a Connector Pack license in order to use this module. |
<dependency>
<groupId>info.magnolia.external.dam</groupId>
<artifactId>magnolia-external-dam-cloudinary</artifactId>
<version>2.1.4</version>
</dependency>
<dependency>
<groupId>info.magnolia.external.dam</groupId>
<artifactId>cloudinary-media-widget-integration</artifactId>
<version>2.1.4</version>
</dependency>
Cloudinary starter templates
The Cloudinary External DAM module includes basic starter component templates. You can extend the templates as needed.
What’s included in the templates?
The component template renders an image (or video) from Cloudinary. It does not include any CSS or design elements.
You can find the template(s) at /src/main/resources/cloudinary-media-widget-integration/templates/components/<template>.
templateScript: /cloudinary-media-widget-integration/templates/components/cloudinary-image.ftl
dialog: cloudinary-media-widget-integration:components/cloudinary-image
renderType: freemarker
title: Cloudinary image
<div class>
[#if content.image?has_content]
[#assign asset = damfn.getAsset(content.image)!]
[#if asset?has_content && asset.link?has_content]
<img src="${asset.link}" alt="">
[/#if]
[/#if]
</div>
templateScript: /cloudinary-media-widget-integration/templates/components/cloudinary-video.ftl
dialog: cloudinary-media-widget-integration:components/cloudinary-video
renderType: freemarker
title: Cloudinary video
<div class>
[#assign videoAsset = damfn.getAsset(content.cloudinaryVideo)!]
[#if videoAsset?has_content && videoAsset.link?has_content && videoAsset.mimeType?starts_with("video/")]
<video controls playsinline width="100%">
<source src="${videoAsset.link}" type="${videoAsset.mimeType!}">
</video>
[/#if]
</div>