You are here

function template_preprocess_baguettebox_formatter in baguetteBox.js 8

Prepares variables for baguettebox formatter templates.

Default template: baguettebox-formatter.html.twig.

Parameters

array $variables: An associative array containing:

  • item: An ImageItem object.
  • item_attributes: An optional associative array of html attributes to be placed in the img tag.
  • image_style: An optional image style.
  • url: An optional \Drupal\Core\Url object.

File

./baguettebox.module, line 40
Primary module hooks for Baguettebox module.

Code

function template_preprocess_baguettebox_formatter(array &$variables) {
  module_load_include('inc', 'image', 'image.field');
  template_preprocess_image_formatter($variables);
  $variables['link_attributes'] = new Attribute($variables['link_attributes']);
}