← All changes
|
modules/atomic-widgets/elements/atomic-button/atomic-button.html.twig
+15
-19
4.0.9
→
4.1.0-beta1
View file →
| @@ -1,19 +1,15 @@ | ||
| 1 | -{% if settings.text is not empty %} | |
| 2 | - {%- set allowed_tags = '<b><strong><sup><sub><s><em><i><u><del><span><br>' %} | |
| 3 | - {% set classes = settings.classes | merge( [ base_styles.base ] ) | join(' ') %} | |
| 4 | - {% set id_attribute = settings._cssid is not empty ? 'id=' ~ settings._cssid | e('html_attr') : '' %} | |
| 5 | - {% if settings.link and settings.link.attributes is not empty %} | |
| 6 | - <{{ settings.link.tag | e('html_tag') }} | |
| 7 | - {{ settings.link.attributes | raw }} | |
| 8 | - class="{{ classes }}" | |
| 9 | - data-interaction-id="{{ interaction_id }}" | |
| 10 | - {{ id_attribute }} {{ settings.attributes | raw }} | |
| 11 | - > | |
| 12 | - {{ settings.text | striptags(allowed_tags) | raw }} | |
| 13 | - </{{ settings.link.tag | e('html_tag') }}> | |
| 14 | - {% else %} | |
| 15 | - <button class="{{ classes }}" data-interaction-id="{{ interaction_id }}" {{ id_attribute }} {{ settings.attributes | raw }}> | |
| 16 | - {{ settings.text | striptags(allowed_tags) | raw }} | |
| 17 | - </button> | |
| 18 | - {% endif %} | |
| 19 | -{% endif %} | |
| 1 | +{% import 'elementor/macros' as m %} | |
| 2 | +{%- set allowed_tags = '<b><strong><sup><sub><s><em><i><u><del><span><br>' -%} | |
| 3 | +{%- set classes = settings.classes | merge( [ base_styles.base ] ) | join(' ') -%} | |
| 4 | +{%- if settings.link is defined and settings.link.href is defined and settings.link.href is not empty -%} | |
| 5 | + <{{ settings.link.tag | default('a') | e('html_tag') }} | |
| 6 | + {{- m.render_link_attributes(settings.link) }} class="{{ classes }}" data-interaction-id="{{ interaction_id }}" | |
| 7 | + {{- m.render_custom_attributes(settings) }}> | |
| 8 | + {{ settings.text | striptags(allowed_tags) | raw }} | |
| 9 | + </{{ settings.link.tag | default('a') | e('html_tag') }}> | |
| 10 | +{%- else -%} | |
| 11 | + <button class="{{ classes }}" data-interaction-id="{{ interaction_id }}" | |
| 12 | + {{- m.render_custom_attributes(settings) }}> | |
| 13 | + {{ settings.text | striptags(allowed_tags) | raw }} | |
| 14 | + </button> | |
| 15 | +{%- endif %} | |