{# /** * Available variables: * - button_base_class - the base class name * - button_modifiers - array of modifiers to add to the base classname * - button_attributes - array of attribute,value pairs * - button_url - the url this button should poing to * - button_content - the content of the button (typically text) * * Available blocks: * - button_content - used to replace the content of the button with something other than text * for example: to insert an icon */ #} {% set button_base_class = button_base_class|default('button') %} {% set classes_array = [button_base_class] %} {% if button_modifiers is defined %} {% for button_modifier in button_modifiers %} {% set classes_array = classes_array|merge(["#{button_base_class}--#{button_modifier}"]) %} {% endfor %} {% set button_classes = classes_array|join(' ') %} {% else %} {% set button_classes = button_base_class %} {% endif %} <button class="{{ button_classes }}" {% for attribute,value in button_attributes %} {{ attribute }}="{{ value }}" {% endfor %} href="{{ button_url }}" > {% block button_content %} {{ button_content }} {% endblock %} </button>