You are here

image_formatter_link_to_image_style.module in Image formatter link to image style 8

Same filename and directory in other branches
  1. 7 image_formatter_link_to_image_style.module

Provides an additional formatter for image core field, to link to an image style.

File

image_formatter_link_to_image_style.module
View source
<?php

/**
 * @file
 * Provides an additional formatter for image core field,
 * to link to an image style.
 */

/**
 * Implements hook_theme().
 */
function image_formatter_link_to_image_style_theme() {
  return array(
    'image_formatter_link_to_image_style_formatter' => array(
      'variables' => array(
        'item' => NULL,
        'item_attributes' => NULL,
        'url' => NULL,
        'url_attributes' => NULL,
        'image_style' => NULL,
      ),
      'file' => 'image_formatter_link_to_image_style.field.inc',
    ),
  );
}

/**
 * Implements hook_theme_suggestions_HOOK().
 */
function image_formatter_link_to_image_style_theme_suggestions_image_formatter_link_to_image_style_formatter(array $variables) {
  $suggestions = array();
  $suggestions[] = 'image_formatter_link_to_image_style_formatter__' . $variables['item']
    ->getFieldDefinition()
    ->getName();
  return $suggestions;
}