← All changes
|
modules/atomic-widgets/elements/atomic-button/atomic-button.html.twig
+21
-9
4.3.0
→
4.0.0-dev3
View file →
| @@ -1,9 +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 has_link = settings.link is defined and settings.link.href is defined and settings.link.href is not empty -%} | |
| 4 | -{%- set classes = settings.classes | merge( [ base_styles.base, m.default_tag_class(tag) ] ) | join(' ') -%} | |
| 5 | -<{{ tag | e('html_tag') }} | |
| 6 | - {%- if has_link %}{{ m.render_link_attributes(settings.link) }}{% endif %} class="{{ classes }}" data-interaction-id="{{ interaction_id }}" | |
| 7 | - {{- m.render_custom_attributes(settings) }}> | |
| 8 | - {{ settings.text | striptags(allowed_tags) | raw }} | |
| 9 | -</{{ tag | e('html_tag') }}> | |
| 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.href %} | |
| 6 | + <{{ settings.link.tag | e('html_tag') }} | |
| 7 | + {% set linkAttr = settings.link.tag == 'a' ? 'href' : 'data-action-link' %} | |
| 8 | + {{ linkAttr }}="{{ settings.link.href | raw }}" | |
| 9 | + target="{{ settings.link.target }}" | |
| 10 | + class="{{ classes }}" | |
| 11 | + data-interaction-id="{{ interaction_id }}" | |
| 12 | + {{ id_attribute }} {{ settings.attributes | raw }} | |
| 13 | + > | |
| 14 | + {{ settings.text | striptags(allowed_tags) | raw }} | |
| 15 | + </{{ settings.link.tag | e('html_tag') }}> | |
| 16 | + {% else %} | |
| 17 | + <button class="{{ classes }}" data-interaction-id="{{ interaction_id }}" {{ id_attribute }} {{ settings.attributes | raw }}> | |
| 18 | + {{ settings.text | striptags(allowed_tags) | raw }} | |
| 19 | + </button> | |
| 20 | + {% endif %} | |
| 21 | +{% endif %} | |