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.
See also
2 theme calls to linkicon-item.html.twig
- LinkIconFormatter::viewElements in src/
Plugin/ Field/ FieldFormatter/ LinkIconFormatter.php - Builds a renderable array for a field value.
- LinkIconFormatterTrait::settingsForm in src/
Plugin/ Field/ FieldFormatter/ LinkIconFormatterTrait.php
File
templates/linkicon-item.html.twigView source
- {#
- /**
- * @file
- * 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.
- *
- * @see template_preprocess_linkicon_item()
- *
- * @ingroup themeable
- */
- #}
- {%
- set title_classes = [
- icon ? 'linkicon__text' : 'linkicon__noicon',
- ]
- %}
- {% if settings.link %}
- {{ title }}
- {% else %}
- {% if settings.position in ['bottom', 'right'] %}
- <span{{ title_attributes.addClass(title_classes) }}>{{ title }}</span>
- {{ icon }}
- {% else %}
- {{ icon }}
- <span{{ title_attributes.addClass(title_classes) }}>{{ title }}</span>
- {% endif %}
- {% endif %}