my-cta.twig
Same filename and directory in other branches
{% if target is not empty %}
{% set attributes = attributes.setAttribute('target', target) %}
{% endif %}
{% if variant is not empty %}
{% set attributes = attributes.addClass('my-cta-' ~ variant) %}
{% endif %}
<a {{ attributes }} href="{{ href }}">
{{ text }}
</a>
File
-
core/
modules/ system/ tests/ modules/ sdc_test/ components/ my-cta/ my-cta.twig
View source
- {% if target is not empty %}
- {% set attributes = attributes.setAttribute('target', target) %}
- {% endif %}
- {% if variant is not empty %}
- {% set attributes = attributes.addClass('my-cta-' ~ variant) %}
- {% endif %}
-
- <a {{ attributes }} href="{{ href }}">
- {{ text }}
- </a>
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.