Scald: Media Management made easy

1. Installation

Dependencies

Scald depends only on the core Entity subsystem. However, to make it more useful, you need some submodules, each requires other contrib modules.

  • DnD: features drag and drop interface for Scald atoms. DnD support many libraries, however if you don't want to use your own, the scald_dnd_library module (requires Views) is available.
  • MEE (Multimedia Editorial Element): extends core's text field. It requires of course core's field and text modules and Scald's DnD module.
  • Atom Reference: requires only DnD

A richtext editor like CKEditor or TinyMCE is not required, but is fully supported within Scald submodules (DnD, MEE). Scald handles both of the following methods :

  • CKEditor module: with this RTE being the default one in D8 and its compatibility with the wonderful Quick Edit module, we recommend that you use this module for further benefits
  • Wysiwyg module: using this method, you will be able to use the RTE of your choice with Scald (CKEditor, TinyMCE)

If you are switching to the CKEditor module, and you still have the Wysiwyg module enabled, make sure that there is no configuration for CKEditor in the Wysiwyg module, to avoid a double declaration issue.

If using the CKEditor module and library, it is recommended to use the widget feature of the library. Instructions on how to do that is available under "CKEditor 4.3 Widget support" below.
CKEditor version 4.4 or higher is recommended.

Scald supports many media providers like Video, Image, Audio in its submodules. Many providers are available as separate contrib modules:
List of Scald providers

qTip previews are also supported from the Drag and Drop library. To be able to customize the qTip behavior the latest development release of the 2.x branch of the qTip module is required.

Finally, Scald Quickstart module comes with precustomized providers, fields and permissions to help you quickly test Scald features.

2. Configuration

In any case, enable the DnD and Scald DnD Library modules to have the default library browser, that integrates with exposed filters, inline atom edit, drag and drop support.

Permissions

By default, no one is allowed to do anything. To make it more useful:

  • Everyone should have the "fetch" permission (the fetchable concept allows us to do "soft delete"): Fetch any atom marked as Fetchable
  • Everyone should also have the "view" permission to view atoms View any atom marked as Viewable.

By default, atoms are only fetchable and viewable. A normal user with "edit any atom marked as Editable" can't edit atoms because they are not editable. It is a safe default because Scald is designed with shared media in mind and when an atom is created it can be used in many places, so one should not modify it.

To make atoms editable (or deletable) by default, navigate to each atom type (admin/structure/scald/TYPE) and change the default open actions. This change affects only new atoms.

With Scald access control system, the following workflow is supported out of the box:

  • To view an atom, people needs permissions. It's possible to prevent anonymous (or any roles) from viewing atoms.
  • To edit or delete any/own atom, people needs seperate permissions.
  • Without permission, nobody can do anything, on any atom, without exception. Only with permission, people can do (take action) on "unblocked" (as explained below) atoms.
  • It's possible for administrators to block any atom from any actions (view/edit/delete). Or the otherwise, it's possible to block all atoms and unblock only a few atoms (for people with permissions, of course).
  • It's possible for contributors to block their atoms from any actions by giving them the permission "restrict atom access".

With custom code, new action can also be added and is supported in the same way with the 4 core actions.

Using a textarea field

  • Enable the MEE module
  • In the text field settings (enable Field UI module, go to Structure > Content Types, click on the "manage fields" associated to the content type you want to configure, then click "edit" next to), there are two new options that can be enabled:
    1. DnD (allow drag and drop directly into this textarea)
    2. MEE (allow to track the embedded atoms, to unpublish node based on (primary) atom copyright expiration etc.)
  • In the CKEditor setting, enable the "Scald DnD integration" plugin and move the button ("Edit atom properties") into toolbar. This plugin allows you to change the context and override atom settings directly in the textarea.
  • In the Text formats settings, disable the "Convert URLs into links" filter to prevent JSON data from being converted to links or use https://www.drupal.org/project/scald_link_filter instead of the core filter to solve the issue.

Supported fields

Since Scald 1.2, by default all text fields can be used for DnD/MEE. If you want to limit to some field types, change the mee_field_types variable. For example (in settings.php):

$conf['mee_field_types'] = array('text_with_summary', 'text_long');

CKEditor 4.1 ACF

When you want to use ACF in CKEditor, you need to add the Atom Properties button in CKEditor toolbar because ACF is configured per-button. Otherwise, simply disable ACF feature with CKEDITOR.config.allowedContent = true;

If you want to keep ACF on you will need to go to the CKEditor profile page expand the "Advanced Content Filter" and add the following code to the "Extra Allowed Content" field.
div[data-scald-sid,data-scald-align,data-scald-context,data-scald-options,data-scald-type](dnd-atom-wrapper,dnd-caption-wrapper) or div[*](*)

CKEditor 4.3 Widget support (Available since Scald version 1.4)


If you would like to use the new CKEditor Widget plugin in Scald to make embedded Atoms more robust in the editor, the following steps has to be done:

  • Download a custom build of the CKEditor javascript library, where the widget plugin is included. (It will auto include all of its dependencies as well)
  • (Not needed on new installs) Set the 'mee_store_format' variable to 'embed_div' instead of 'sas'. This can be done manually or from the UI at admin/config/content/dnd - "Wysiwyg store format" ('embed_div' is default since Scald 1.4)
  • In the CKEditor profiles (Generally starting with "Filtered HTML" at /admin/config/content/ckeditor) in the "Editor Appearance" section, select the "Scald Drag and Drop integration - CKEditor 4 widgets" plugin instead of the "Scald Drag and Drop integration" plugin
  • (Optional) Add the Embedded atoms (mee_scald_widgets) filter to the relevant input formats - after the 'filter html tags' filter
  • Double check that MEE is enabled in the settings for the text area, existing atoms may have worked without this however it is required for the widget to work.
  • Double check that the "Advanced content filter" is set up correctly (or disabled) at the CKEditor configuration. admin/config/content/ckeditor
  • Double check that you have the "Edit atom properties" button in the toolbar at the CKEditor configuration.

The new plugin handles upgrade dynamically and transparently, as soon as the textarea gets edited.
Old pages never edited can keep their old format, the mee module continues to handle them the same way; new settings apply just to new or edited textareas.

Choosing a display context

The default display context (sdl_editor_representation) uses no transcoder (in the case of image its an "image style" for example). To change the context in Wysiwyg, just right click on the Atom, choose "Edit atom properties" and select another context.
A transcoder can be selected to the default display context for each Atom type.
For example: admin/structure/scald/image/contexts
These settings can later be exported with the Features module.

Learn more about contexts.

Using an atom reference field

The Atom Reference module creates an atom reference field. This is similar to (entity) reference fields with better control (can reference to multiple bundles etc.).

Drag and drop is also supported into atom reference fields.

3. Features integration

All Scald settings are exportable so that deployment is easy.

- Custom contexts are store in the scald_custom_contexts variable. Other contexts are already defined in code using hook_scald_contexts().
- Context settings: are Ctools exportables under Scald context config component. They can also be exported with the new Features integration separately for each Atom type if the experimental Features export is enabled under admin/structure/scald.
- Other settings are stored as variables.

Note that field settings also use variables e.g. field_bundle_settings_scald_atom__image.

Read more

Please see https://drupal.org/node/2101885 for a list of Scald related resource.

Comments

pbcelery’s picture

After installing Scald and enabling all the contributed modules, I'm not seeing any UI features. No rich media browser, no CKEditor media browser, nothing similar to the png of a media library on scald's project page. Links here for MEE and DND point to code documentation, not projects. Edit: module naming wasn't obvious. It's drush en mee then, Admin > Structure > Basic Page > Fields > Body > Manage field and enable MME and DND checkboxes. Then see media browser on screen left when editing a basic page.

Vladimir1950’s picture

Is it possible to do it without drush, simply inside Admin panel?

Carlos Miranda Levy’s picture

For the above instructions to work, additional steps are required, as discussed, discovered and explained at https://www.drupal.org/node/2346061