linkimage_formatter.html.twig in Link Image Field 8
Default theme implementation to display a LinkImageField.
Available variables:
- image: Rendered image.
- url: href option of link.
- attributes: An array of link attributes.
See also
1 theme call to linkimage_formatter.html.twig
- LinkImageFieldFormatter::viewElements in lib/
Drupal/ linkimagefield/ Plugin/ Field/ FieldFormatter/ LinkImageFieldFormatter.php - Builds a renderable array for a field value.
File
templates/linkimage_formatter.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation to display a LinkImageField.
- *
- * Available variables:
- * - image: Rendered image.
- * - url: href option of link.
- * - attributes: An array of link attributes.
- *
- * @see template_preprocess_linkimage_formatter()
- *
- * @ingroup themeable
- */
- #}
- {% if url %}
- <a href="{{ url }}"{{ attributes }}>{{ image }}</a>
- {% else %}
- {{ image }}
- {% endif %}