You are here

function theme_sooperthemes_gridstack_formatter in Sooperthemes GridStack 7

Implements theme callback function.

1 theme call to theme_sooperthemes_gridstack_formatter()
sooperthemes_gridstack_field_formatter_view in ./sooperthemes_gridstack.module
Implements hook_field_formatter_view().

File

./sooperthemes_gridstack.module, line 185
Code for the SooperThemes GridStack feature.

Code

function theme_sooperthemes_gridstack_formatter($variables) {
  $output = '<div class="sooperthemes-gridstack__img" style="background-image: url(' . $variables['image_url'] . ')"></div>';
  if (isset($variables['path']['path'])) {
    $path = $variables['path']['path'];
    $options = isset($variables['path']['options']) ? $variables['path']['options'] : array();

    // When displaying an image inside a link, the html option must be TRUE.
    $options['html'] = TRUE;
    $output = l($output, $path, $options);
  }
  return $output;
}