You are here

function media_acquiadam_field_formatter_info_alter in Media: Acquia DAM 8

Implements hook_field_formatter_info_alter().

File

./media_acquiadam.module, line 39
Integrates Drupal with Acquia DAM.

Code

function media_acquiadam_field_formatter_info_alter(&$info) {

  // Allow using the image formatter on a file field.
  if (isset($info['image']) && !in_array('file', $info['image']['field_types'])) {
    $info['image']['field_types'][] = 'file';
  }

  // Allow using the responsive image formatter on a file field.
  if (isset($info['responsive_image']) && !in_array('file', $info['responsive_image']['field_types'])) {
    $info['responsive_image']['field_types'][] = 'file';
  }
}