You are here

function template_preprocess_shrinktheweb_formatter_shrinktheweb_link_default in ShrinkTheWeb 8

Displays the thumbnail as '[ShrinkTheWeb] Title as link'.

Parameters

array $variables:

File

./shrinktheweb.module, line 174

Code

function template_preprocess_shrinktheweb_formatter_shrinktheweb_link_default(&$variables) {
  $options = _shrinktheweb_custom_settings($variables);
  $variables['title'] = empty($variables['title']) ? '' : \Drupal\Component\Utility\SafeMarkup::checkPlain($variables['title']);
  $variables['link'] = Link::fromTextAndUrl($variables['title'], Url::fromUri($variables['url']));
  if ($src = shrinktheweb_get_thumbnail($variables['url'], $options)) {
    $variables['image_path'] = $src;
  }
}