a12s-1.0.0-beta7/modules/patterns/templates/patterns/button-link/pattern-button-link.html.twig
modules/patterns/templates/patterns/button-link/pattern-button-link.html.twig
{#
/**
* Template for an HTML button.
*
* Available variables:
* - variant: The pattern variant ID or "" if not specified.
* - attributes: HTML attributes for the containing element.
* - title_attributes: HTML attributes for the title element.
* - content_attributes: HTML attributes for the content element.
* - use: @todo add documentation if necessary, or remove this line.
* - title_prefix: Additional output populated by modules, intended to be
* displayed in front of the main title tag that appears in the template.
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
* - logged_in: A flag indicating if the user is registered and signed in.
* - is_admin: A flag indicating if the user has permission to access
* administration pages.
*/
#}
{% set default_classes = [
'btn',
variant is not empty ? 'btn--' ~ variant
] %}
{% set buttonLabel = "Click me" %}
{% set buttonUrl = "#" %}
<a href="{{ buttonUrl }}" {{ attributes.addClass(classes|default(default_classes)) }} class="{{ buttonClasses|join(' ') }}">
{{ prefix }}
{{ title_prefix }}
{% if wrap_title is not empty %}<div{{ title_attributes }}>{% endif %}
{{ buttonLabel }}
{% if wrap_title is not empty %}</div>{% endif %}
{{ title_suffix }}
{{ suffix }}
</a>
