link-formatter-link-separate.html.twig

Theme override of a link with separate title and URL elements.

Available variables:

  • link: The link that has already been formatted by l().
  • title: (optional) A descriptive or alternate title for the link, which may be different than the actual link text.

See also

\Drupal\link\LinkThemeHooks::preprocessLinkFormatterLinkSeparate()

1 theme call to link-formatter-link-separate.html.twig
LinkSeparateFormatter::viewElements in core/modules/link/src/Plugin/Field/FieldFormatter/LinkSeparateFormatter.php
Builds a renderable array for a field value.

File

core/themes/starterkit_theme/templates/field/link-formatter-link-separate.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override of a link with separate title and URL elements.
  5. *
  6. * Available variables:
  7. * - link: The link that has already been formatted by l().
  8. * - title: (optional) A descriptive or alternate title for the link, which may
  9. * be different than the actual link text.
  10. *
  11. * @see \Drupal\link\LinkThemeHooks::preprocessLinkFormatterLinkSeparate()
  12. */
  13. #}
  14. <div class="link-item">
  15. {%- if title -%}
  16. <div class="link-title">{{- title -}}</div>
  17. {%- endif -%}
  18. <div class="link-url">{{- link -}}</div>
  19. </div>

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.