textimage-formatter.html.twig in Textimage 8.3
Same filename and directory in other branches
Default theme implementation to display a Textimage formatter theme.
Available variables:
- image: A collection of image data.
- anchor_url: (Optional) if specified, the entire output will be wrapped in a <a> anchor.
- anchor_attributes: (Optional) the 'href' attributes of the anchor.
- image_container_attributes : (Optional) if specified, the <img> tag will be wrapped in a <div> container, whose attributes will be set to the array passed here.
See also
4 theme calls to textimage-formatter.html.twig
- TextimageImageFieldFormatter::viewElements in src/
Plugin/ Field/ FieldFormatter/ TextimageImageFieldFormatter.php - Builds a renderable array for a field value.
- TextimageTest::testTextimage in tests/
src/ Functional/ TextimageTest.php - Test functionality of the module.
- TextimageTextFieldFormatter::viewElements in src/
Plugin/ Field/ FieldFormatter/ TextimageTextFieldFormatter.php - Builds a renderable array for a field value.
- TextimageThemeTest::testTextimageFormatterTheme in tests/
src/ Kernel/ TextimageThemeTest.php - Test the Textimage formatter theme.
File
templates/textimage-formatter.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation to display a Textimage formatter theme.
- *
- * Available variables:
- * - image: A collection of image data.
- * - anchor_url: (Optional) if specified, the entire output will be wrapped
- * in a <a> anchor.
- * - anchor_attributes: (Optional) the 'href' attributes of the anchor.
- * - image_container_attributes : (Optional) if specified, the <img> tag will
- * be wrapped in a <div> container, whose attributes will be set to the
- * array passed here.
- *
- * @see template_preprocess_textimage_formatter()
- *
- * @ingroup themeable
- */
- #}
- {% spaceless %}
- {% if image %}
- {% if anchor_url %}
- <a {{ anchor_attributes }}>
- {% endif %}
- {% if image_container_attributes %}
- <div {{ image_container_attributes }}>
- {% endif %}
- {{ image }}
- {% if image_container_attributes %}
- </div>
- {% endif %}
- {% if anchor_url %}
- </a>
- {% endif %}
- {% else %}
- {{ 'Image not available.'|t }}
- {% endif %}
- {% endspaceless %}