Hi,
I just used this code to create a button that has an alignment opition (source: post link ![]()
{{ require_css }}
<style>
.horz-{{ module.button_position }}{
display:flex;
flex-direction:column;
flex-wrap:no-wrap;
justify-content:flex-start;
align-items: {{ module.button_position }};
align-content:center;
}
</style>
{{ end_require_css}}
{% if module.button_link.url.type is equalto ‘EMAIL_ADDRESS’ %}
{% set href = ‘mailto:’ ~ module.button_link.url.href %}
{% elif module.button_link.url.href == ‘/’ %}
{% set href = module.button_link.url.href %}
{% else %}
{% unless (module.button_link.url.href is string_containing ‘//’) or !module.button_link.url.href %}
{% set href = ‘//’ ~ module.button_link.url.href %}
{% else %}
{% set href = module.button_link.url.href || ‘’ %}
{% endunless %}
{% endif %}
{% set rel = (module.button_link.open_in_new_tab ? 'noopener ’ : null) ~ (module.button_link.no_follow ? ‘nofollow’ : null) %}
<div class=“horz-{{module.button_position}}”>
<{% if module.button_options.button_link_toggle == true %}a href=“{{ href }}” {% else %}button {% endif %} class=“button{% if module.style.button_type == ‘secondary’ %} button--secondary{% elif module.style.button_type == ‘simple’ %} button--simple{% endif %}{% if module.style.button_size == ‘small’ %} button--small{% elif module.style.button_size == ‘large’ %} button--large{% endif %}{% if module.button_icon.icon_position == ‘right’ %} button--icon-right{% endif %}”
id=“button_{{ name }}”
{% if module.button_link.open_in_new_tab %}target=“_blank”{% endif %}
rel=“{{ rel }}”>
{% if module.button_options.button_icon_toggle == true and module.button_icon.icon_field.unicode %}
{% icon
extra_classes=‘button__icon’
name=‘{{ module.button_icon.icon_field.name }}’
purpose=‘decorative’
style=‘{{ module.button_icon.icon_field.type }}’
unicode=‘{{ module.button_icon.icon_field.unicode }}’
%}
{% endif %}
{{ module.button_text }}
</{% if module.button_options.button_link_toggle == true %}a{% else %}button{% endif %}>
</div>
Now i have a new problem: every time i tried an internal or external link, it doesn’t work and i remain on the same page.
I don’t know how to resolve it.
Im gonna attach here a screenshot of the code
:

