You are here

function template_preprocess_pdfpreview_formatter in PDFPreview 8

Same name and namespace in other branches
  1. 2.0.x pdfpreview.module \template_preprocess_pdfpreview_formatter()

Prepares variables for pdfpreview_formatter element templates.

Default template: pdfpreview-formatter.html.twig.

Parameters

array $variables: An associative array containing:

  • element: An associative array containing the properties of the element.

File

./pdfpreview.module, line 44
Generates image previews of PDF files.

Code

function template_preprocess_pdfpreview_formatter(array &$variables) {
  $settings = $variables['element']['#settings'];
  $variables['tag'] = $settings['tag'];
  $variables['fid'] = $variables['element']['#fid'];
  $variables['description'] = $settings['show_description'] ? $variables['element']['#description'] : '';
}