<img>
element is also acceptable.
size
and background
props for the icon component are not well supported in this scenario.<span class="e-bolt-text-link__icon-before">
and <span class="e-bolt-text-link__icon-after">
are required to wrap around the icon markup. The wrapper ensures that the icon will always wrap with the final word of the text. It will never wrap to the next line on its own.This is a text link with icons before and after
{% set icon_custom %}
<img src="/images/placeholders/500x500.jpg">
{% endset %}
{% set icon_chevron_down %}
{% include '@bolt-elements-icon/icon.twig' with {
name: 'chevron-down',
} only %}
{% endset %}
{% include '@bolt-elements-text-link/text-link.twig' with {
content: 'This is a text link with icons before and after',
icon_before: icon_custom,
icon_after: icon_chevron_down,
attributes: {
href: 'https://google.com',
}
} only %}
<a href="https://google.com" class="e-bolt-text-link"><span class="e-bolt-text-link__icon-before"><!-- Icon or image markup --></span>This is a text link with icons before and after<span class="e-bolt-text-link__icon-after"><!-- Icon or image markup --></span></a>