Hi @libbyh ,
Thank you for reaching out about adding multiple buttons that display horizontally in the Dawn theme’s Image with Text section. I’m happy to provide a solution for this!
You’ve already correctly modified the button limit to 3 by changing:
"type": "button",
"name": "t:sections.image-with-text.blocks.button.name",
"limit": 3,
To make these buttons display side by side instead of stacked, you’ll need to make the following changes:
Step 1: Modify your button block code in the image-with-text.liquid file. Find this section:
{%- when 'button' -%}
{%- if block.settings.button_label != blank -%}
<a
{% if block.settings.button_link == blank %}
role="link" aria-disabled="true"
{% else %}
href="{{ block.settings.button_link }}"
{% endif %}
class="button{% if block.settings.button_style_secondary %} button--secondary{% else %} button--primary{% endif %}"
{{ block.shopify_attributes }}
>
{{ block.settings.button_label | escape }}
</a>
{%- endif -%}
Replace it with this code:
{%- when 'button' -%}
{% if forloop.first %}
<div class="button-container">
{% endif %}
{%- if block.settings.button_label != blank -%}
<a
{% if block.settings.button_link == blank %}
role="link" aria-disabled="true"
{% else %}
href="{{ block.settings.button_link }}"
{% endif %}
class="button{% if block.settings.button_style_secondary %} button--secondary{% else %} button--primary{% endif %}"
{{ block.shopify_attributes }}
>
{{ block.settings.button_label | escape }}
</a>
{%- endif -%}
{% if forloop.last %}
</div>
{% endif %}
Step 2: Add CSS for the button container. Go to your Theme Editor (Customize → Theme Settings → Custom CSS) and add this CSS:
.button-container {
display: flex;
flex-wrap: wrap;
gap: 1rem;
margin-top: 1.5rem;
}
.button-container .button {
margin-top: 0;
}
@media screen and (max-width: 749px) {
.button-container {
flex-direction: column;
}
.button-container .button {
width: auto;
margin-top: 1rem;
}
.button-container .button:first-child {
margin-top: 0;
}
}
This will create a container that:
- Displays buttons in a row on desktop
- Adds proper spacing between buttons
- Stacks buttons vertically on mobile for better user experience
After making these changes, your multiple buttons should display side-by-side on desktop and stack neatly on mobile devices.
If you’ve any questions, directly reach out to us via email.
Best regards,
Shubham | Untechnickle