← All changes
|
modules/atomic-widgets/elements/atomic-button/atomic-button.html.twig
+21
-15
4.2.1
→
3.35.0-dev2
View file →
| @@ -1,15 +1,21 @@ | ||
| 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 %} | |
| 1 | +{% if settings.text is not empty %} | |
| 2 | + {% set classes = settings.classes | merge( [ base_styles.base ] ) | join(' ') %} | |
| 3 | + {% set id_attribute = settings._cssid is not empty ? 'id=' ~ settings._cssid | e('html_attr') : '' %} | |
| 4 | + {% if settings.link.href %} | |
| 5 | + <{{ settings.link.tag | e('html_tag') }} | |
| 6 | + {% set linkAttr = settings.link.tag == 'a' ? 'href' : 'data-action-link' %} | |
| 7 | + {{ linkAttr }}="{{ settings.link.href | raw }}" | |
| 8 | + target="{{ settings.link.target }}" | |
| 9 | + class="{{ classes }}" | |
| 10 | + data-interaction-id="{{ id }}" | |
| 11 | + data-interactions="{{ interactions | json_encode | e('html_attr') }}" | |
| 12 | + {{ id_attribute }} {{ settings.attributes | raw }} | |
| 13 | + > | |
| 14 | + {{ settings.text }} | |
| 15 | + </{{ settings.link.tag | e('html_tag') }}> | |
| 16 | + {% else %} | |
| 17 | + <button class="{{ classes }}" data-interaction-id="{{ id }}" data-interactions="{{ interactions | json_encode | e('html_attr') }}" {{ id_attribute }} {{ settings.attributes | raw }}> | |
| 18 | + {{ settings.text }} | |
| 19 | + </button> | |
| 20 | + {% endif %} | |
| 21 | +{% endif %} | |