You are here

linkicon-item.html.twig in Link Icon 8

Default theme implementation to display a linkicon item.

Available variables:

  • title: The link text or title, already sanitized at viewElements.
  • icon_name: The icon name, e.g.: twitter, facebook, etc.
  • settings: The formatter settings.
  • attributes: An associative array of attributes to be placed in the span tag.

File

templates/linkicon-item.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display a linkicon item.
  5. *
  6. * Available variables:
  7. * - title: The link text or title, already sanitized at viewElements.
  8. * - icon_name: The icon name, e.g.: twitter, facebook, etc.
  9. * - settings: The formatter settings.
  10. * - attributes: An associative array of attributes to be placed in the span
  11. * tag.
  12. *
  13. * @see template_preprocess_linkicon_item()
  14. *
  15. * @ingroup themeable
  16. */
  17. #}
  18. {%
  19. set title_classes = [
  20. icon ? 'linkicon__text' : 'linkicon__noicon',
  21. ]
  22. %}
  23. {% if settings.link %}
  24. {{ title }}
  25. {% else %}
  26. {% if settings.position in ['bottom', 'right'] %}
  27. <span{{ title_attributes.addClass(title_classes) }}>{{ title }}</span>
  28. {{ icon }}
  29. {% else %}
  30. {{ icon }}
  31. <span{{ title_attributes.addClass(title_classes) }}>{{ title }}</span>
  32. {% endif %}
  33. {% endif %}