templates/default/components/atoms/text-link/text-link.html.twig line 1

Open in your IDE?
  1. {% import 'macros/storyblok.html.twig' as storyblok %}
  2. {% if reserveBoldSpace|default(false) and text is defined %}
  3. {% set attributes = attributes|default([])|merge({'data-reserve-bold-space': text}) %}
  4. {% endif %}
  5. {% set inner %}
  6. {% block linkText %}
  7. {{- text|raw -}}
  8. {% endblock %}
  9. {# check if class is defined and if a arrow modifier was set (inline-arrow or arrow-right) #}
  10. {% if class is defined and 'arrow' in class %}
  11. <span class="text-link__arrow"></span>
  12. {% endif %}
  13. {% endset %}
  14. {% if href|default(false) %}
  15. <a
  16. href="{{ storyblok.storyblokLink(href)|spaceless }}"
  17. {% if target is defined and target != "" %}target="{{ target }}"{% endif %}
  18. class="{{ class|default('text-link') }} {{ modifier|default('') }}"
  19. {{ attributes|default([])|getAttributes }}
  20. {{ (gtm|default(false) ? gtm : '') }}
  21. >
  22. {{ inner }}
  23. </a>
  24. {% else %}
  25. <span class="{{ class|default('text-link') }} {{ modifier|default('') }}" {{ attributes|default([])|getAttributes }} {{ (gtm|default(false) ? gtm : '') }}>
  26. {{ inner }}
  27. </span>
  28. {% endif %}