You are here

linkicon.html.twig in Link Icon 8

Default theme implementation for the Link icon template.

Available variables:

  • items: An array of items containing links with icon formatted.
  • settings: An array of settings that decides the link icon output.
  • attributes: The array of attributes to hold classes, id and optional data-title to display as tooltip.

File

templates/linkicon.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for the Link icon template.
  5. *
  6. * Available variables:
  7. * - items: An array of items containing links with icon formatted.
  8. * - settings: An array of settings that decides the link icon output.
  9. * - attributes: The array of attributes to hold classes, id and optional
  10. * data-title to display as tooltip.
  11. *
  12. * @see template_preprocess_linkicon()
  13. *
  14. * @ingroup themeable
  15. */
  16. #}
  17. {%
  18. set wrapper_classes = [
  19. 'item-list',
  20. 'item-list--linkicon',
  21. settings.wrapper_class ? settings.wrapper_class|clean_class,
  22. ]
  23. %}
  24. {% if settings.load %}
  25. {%
  26. set classes = [
  27. not settings.vertical ? 'linkicon--inline',
  28. settings.color ? 'linkicon--color',
  29. settings.no_text ? 'linkicon--no-text',
  30. settings.color ? 'linkicon--' ~ settings.color|clean_class,
  31. settings.style ? 'linkicon--' ~ settings.style|clean_class,
  32. settings.size and not settings._preview ? 'linkicon--' ~ settings.size|clean_class,
  33. settings.tooltip ? 'linkicon--tooltip',
  34. settings.position ? 'linkicon--' ~ settings.position|clean_class,
  35. ]
  36. %}
  37. {% endif %}
  38. {% spaceless %}
  39. <div{{ wrapper_attributes.addClass(wrapper_classes) }}>
  40. <ul{{ attributes.addClass('linkicon', classes) }}>
  41. {%- for item in items -%}
  42. <li>
  43. {{ item }}
  44. </li>
  45. {%- endfor -%}
  46. </ul>
  47. </div>
  48. {% endspaceless %}