Configure the Media Integration widget
When using the Media Integration widget, the regular Cloudinary Assets subapp is hidden. Instead, Cloudinary content is managed within the Choose Dialog.
Prerequisites
To use this module you need to have an existing Cloudinary account.
The Cloudinary Media Integration widget requires a specific activation flag in the Cloudinary instance. Without the activation flag, the widget displays a login screen.
|
From your Cloudinary account, you need the following:
-
cloudName
-
apiKey
-
userName
-
apiSecret
This information needs to be entered either in the Passwords app under the /cloudinary/default
folder or as a decoration in your light module.
Decorate config.yaml
This should be done via a decorations registry in your own light module.
The decorations you define impact the Media Integration widget’s config.yaml
file.
config.yaml
accounts:
default: (1)
apiKey: CLOUDINARY_API_KEY_HERE
apiSecret: CLOUDINARY_API_SECRET_HERE
cloudName: CLOUDINARY_CLOUD_NAME_HERE
userName: CLOUDINARY_USERNAME
assetManager: (2)
apiKey: CLOUDINARY_API_KEY_HERE
apiSecret: CLOUDINARY_API_SECRET_HERE
cloudName: CLOUDINARY_CLOUD_NAME_HERE
userName: CLOUDINARY_USERNAME
assetViewer: (2)
apiKey: CLOUDINARY_API_KEY_HERE
apiSecret: CLOUDINARY_API_SECRET_HERE
cloudName: CLOUDINARY_CLOUD_NAME_HERE
userName: CLOUDINARY_USERNAME
1 | Default fallback role. |
2 | Defines the role to which you can add users. |
config.yaml
accounts:
default: (1)
apiKey: CLOUDINARY_API_KEY_HERE
apiSecret: CLOUDINARY_API_SECRET_HERE
cloudName: CLOUDINARY_CLOUD_NAME_HERE
userName: CLOUDINARY_USERNAME
superuser: (2)
apiKey: CLOUDINARY_API_KEY_HERE
apiSecret: CLOUDINARY_API_SECRET_HERE
cloudName: CLOUDINARY_CLOUD_NAME_HERE
userName: CLOUDINARY_USERNAME
1 | Default user. |
2 | Specifies a superuser user. |
your-light-module/ (1) ├── decorations/ (2) │ └── cloudinary-media-widget-integration/ (3) └── config.yaml (4)
1 | From within your own light module. |
2 | The decorations registry. |
3 | This tells Magnolia to decorate the cloudinary-media-widget-integration module. |
4 | Use the config.yaml file to decorate as you see fit. |
For more on decorating via light modules, see Definition decoration.
Configure server
-
First modify your server URL in AdminCentral.
-
Under
config/server
, change thedefaultBaseUrl
property to point your own instance andcontextRoot
.
Override default account
From Cloudinary External DAM module version 2.1.0 and later, this feature no longer works.
This is because credentials are role-based instead of user-based from 2.1.0 .
|
You can override the default account settings by providing user specific settings.
Put the user specific account under the Magnolia username
.
Installing this module hides the Cloudinary DAM app. To keep using the Cloudinary DAM app, you must manually enable it.
-
Go to your Resources app.
-
Navigate to "/cloudinary-media-widget-integration/decorations/dam-app-core/apps/dam.subApps.cloudinaryBrowser.yaml" file.
-
Set "hidden" property to "false".
Usage
You can use a Magnolia field in any dialog:
form:
implementationClass: info.magnolia.ui.javascript.form.FormViewWithChangeListener
properties:
image:
label: Cloudinary Image
$type: cloudinaryWidgetField
After opening magnolia dialog and clicking on select image button, you are presented with Cloudinary widget select dialog.
Additional info
When installed, this module hides the Cloudinary Assets subapp and Cloudinary content in the Choose dialog by default.
-
To enable the Cloudinary Assets subapp, set closable to
true
forcloudinaryBrowser
subapp in the DAM configuration yaml. -
To enable the Cloudinary content in the Assets Choose dialog, set
showCloudinaryContentInChooseApp
totrue
for thecloudinary-media-widget-integration
module configuration yaml.
For decorations to work consistently, you need to add the following in your light modules: |
/module.yaml
version: 1.0
dependencies:
dam-cloudinary:
version: 2.1.0/*
cloudinary-media-widget-integration:
version: 2.1.0/*