template_preprocess_link_formatter_link_separate

template_preprocess_link_formatter_link_separate(&$variables)

Prepares variables for separated link field templates.

This template outputs a separate title and link.

Default template: link-formatter-link-separate.html.twig.

Parameters

array $variables: An associative array containing:

  • title: (optional) A descriptive or alternate title for the link, which may be different than the actual link text.
  • url_title: The anchor text for the link.
  • url: A \Drupal\Core\Url object.

File

core/modules/link/link.module, line 63
Defines simple link field types.

Code

function template_preprocess_link_formatter_link_separate(&$variables) {
  $variables['link'] = \Drupal::l($variables['url_title'], $variables['url']);
}
doc_Drupal
2016-10-29 09:46:44
Comments
Leave a Comment

Please login to continue.