Newer
Older
{#
/**
* Available variables:
* - link_content - the content of the link (typically text)
* - link_url - the url this link should poing to
* - link_attributes - array of attribute,value pairs
* - link_base_class - the base class name
* - link_modifiers - array of modifiers to add to the base classname
#}
{% set link_base_class = link_base_class|default('link') %}
{% set classes_array = [link_base_class] %}
{% if link_modifiers is defined %}
{% for link_modifier in link_modifiers %}
{% set classes_array = classes_array|merge(["#{link_base_class}--#{link_modifier}"]) %}
{% endfor %}
{% set link_classes = classes_array|join(' ') %}
{% else %}
{% set link_classes = link_base_class %}
{% endif %}
<a
class="{{ link_classes }}"
{% for attribute,value in link_attributes %}
{{ attribute }}="{{ value }}"
{% endfor %}
href="{{ link_url }}"
>
{% block link_content %}
<span class="link-content">{{ link_content }}</span>
{% endblock %}
</a>