Comparison of Asset Management modules
These are modules that allow you to manage (multi)media assets. Modules that manage only images are left out because they are already compared in another handbook page.
| Name | Media | Scald | Asset |
|---|---|---|---|
| Since (all/7.x) | Mar 2005 (Jun 2010) | Jul 2008 (May 2012) | May 2007 (Jul 2012) |
| Installs | 105K | 200 | 400 |
| Dependency | Views, CTools, File Entity (2.x), Image | Views, CTools | Views, CTools, Entity API, Field UI, Field SQL Storage |
| D6 | no | beta | no |
| D7 | 1.x stable, 2.x unstable | stable | beta |
| D8 | ? | ? | ? |
| WYSIWYG integration | WYSIWYG or CKEditor module | any module (CKEditor preferred) | CKEditor module |
| Richtext editors |
Setting up WYSIWYG and CKEditor to include Media Browser / Embed Media button
These instructions assume that Media has already been installed.
Install and enable the WYSWYIG module
Clear cache and follow instructions found at /admin/config/content/wysiwyg:
These instructions point you to the main CK Editor download page, but as of 1/7/2013, you need to download CKEditor 3.6, not their latest, 4.0.
- The download link for the CKEditor 3.6 library is http://download.cksource.com/CKEditor/CKEditor/CKEditor%203.6.6/ckeditor...
- There is a bug in Drupal when using the latest version (4.0) - details found here http://drupal.org/node/1853550
Create sites/all/libraries folder in your Drupal site if it doesn’t exist already and extract CKEditor folder there.
Refresh /admin/config/content/wysiwyg, you are now presented with a list of available Text Formats in the site. We’ll want the “Full HTML” filter to use the WYSIWYG toolbar, but first we must configure that Full HTML filter properly on a different page.
Go to /admin/config/content/formats, and drag the “Full HTML” row to be the first row, above Filtered HTML. Click save.
- Setting “Full HTML” first sets it to the default text format for nodes to use in the node edit form.
Asset
The Asset module proposes a new approach to the media management in Drupal, resolving a long-standing problem of reusable media files (images, videos, documents, etc) that evolved into the problem of reusable media content (images/videos/documents/etc with the attached content like description/licence/etc).
Migration from other solutions
This is just an outline, please help completing this page with more details.
It is quite easy to migrate from many other "media" solutions to Scald.
From IMCE/embedded images modules
Get a list of used files from the text fields/from the {files} table and create scald_image atoms. Enable MEE module.
From File Entity based modules
Add an atom for each file, use hooks to create new atom when a file is added.
From File Field modules
Use Atom Reference module.
From nonexistent module
Just install Scald module.
The Atom reference module
Introduction
The atom reference modules provides a field where atoms can be drag and dropped from the library. This allows the user to make a reference from any entity where the field has been inserted to an atom or a list of atoms. This can per example be used to create a media gallery.
PHP
Core hooks used
hook_field_info() :
Define the field information see api documentation.
hook_field_instance_settings_form() :
Field properties for the form when the field is added to an entity. See api documentation.
hook_field_schema() :
Defines the field database column. We use only one, the atom sid. Please see hook field schema
hook_field_validate() :
We check that the referenced atoms type is in the list of type that is allowed for the field.api documentation
hook_field_is_empty() :
Read moreThe Mee Module
Introduction
The Mee Module is the module transforming a standard textarea field into a scald enabled drag and droppable field. It also generates the ressource manager located under the field.
This ressource manager allows the user to order the dragged elements into primary and secondary ressources. This can be useful to build a view showing which media are in which entities, or to use a cron to unpublish an entity when a primary ressource is no more licenced.
We will look below into the code to demonstrate how it's built.
Php
Core hooks used
hook_field_info_alter() :
We add default values in the settings of instance :
$info['text_with_summary']['instance_settings']['dnd_enabled'] = 0;hook_form_alter() :
We add three settings for the textarea field :
dnd_enabled > We enable the drag and drop capabilities
mee_enabled > add the ressource manager below the field
context > Choose the scald representation to be used when a element will be dropped in the textarea
Hooks on behalf of the text module
hook_field_presave()
Before storing in the database the content of the field, we transform the content of the Scald atom to the SAS version
hook_field_insert()
We extract the Atom Id's used in the field and we store them in the mee_resource table :