Adding a 2nd button to the Image with Text section in Dawn theme

Topic summary

A user needs to add a second button to the Image with Text section in Shopify’s Dawn theme and have both buttons display side-by-side instead of stacked vertically. They’ve already changed the limit to “2” in the schema, which allows adding a second button, but it appears below the first.

Two solutions were proposed:

  1. Liquid code modification (Ignelis): Loop through all button blocks and wrap them in a container, then adjust CSS styling to align them horizontally. The solution involves editing image-with-text.liquid and replacing the button rendering code.

  2. CSS-only approach (PageFly-Richard): Add custom CSS to component-image-with-text.css using flexbox properties (flex-direction: unset, flex-wrap: wrap, gap: 10px) to position buttons side-by-side without modifying Liquid files.

A follow-up request asks for the complete updated code implementation, indicating the user may need more detailed guidance on applying these solutions.

Summarized with AI on November 16. AI used: claude-sonnet-4-5-20250929.

I need to add a second button to the Image with Text section in the Dawn theme and have them align next to each. I see that changing the limit to “2” allows me to add the additional button but it puts it below the first button rather than next to it.

    {
      "type": "button",
      "name": "t:sections.image-with-text.blocks.button.name",
      "limit": 2,
      "settings": [
        {
          "type": "text",
          "id": "button_label",
          "default": "Button label",
          "label": "t:sections.image-with-text.blocks.button.settings.button_label.label",
          "info": "t:sections.image-with-text.blocks.button.settings.button_label.info"
        },
        {
          "type": "url",
          "id": "button_link",
          "label": "t:sections.image-with-text.blocks.button.settings.button_link.label"
        }
      ]
    }

Hey, @snacky !

  1. In the Shopify admin, go to Online Store > Themes > Actions > Edit Code.

  2. In the left-hand side menu, click on Sections and open the file image-with-text.liquid.

  3. Find the code for the button section you shared in your question. It should be something like this:

{% for block in section.blocks %}
{% if block.type == 'button' %}

{{ block.settings.button_label }}

{% endif %}
{% endfor %}
  1. Replace it to this:
{% assign buttons = section.blocks | where: 'type', 'button' %}
{% if buttons.size > 0 %}
  
    {% for block in buttons %}
      {{ block.settings.button_label }}
    {% endfor %}
  

{% endif %}
  1. Save changes

This new code will loop through all the button blocks in the Image with Text section and display them side by side in a button-wrapper container.

Note: You may need to adjust the CSS styling of the buttons and the button wrapper to make sure they align and look the way you want.

Let me know if this works!

Hi @snacky ,

This is Richard from PageFly - Landing page builder, I’d like to suggest this idea:
Step 1: Go to Online Store->Theme->Edit code
Step 2: Asset->/component-image-with-text.css->paste below code at the bottom of the file:

.image-with-text__text-item .image-with-text__content {
	 flex-direction: unset !important;
	 flex-wrap: wrap !important;
	 gap: 10px !important;
}
 .image-with-text__text-item .image-with-text__content .image-with-text__text {
	 margin-bottom: 20px !important;
}
 .image-with-text__text-item .image-with-text__content > *:not(.button) {
	 width: 100% !important;
}
 .image-with-text__text-item .image-with-text__content .button {
	 margin: 0 !important;
}

I hope it would help you
Best regards,

Richard | PageFly

Could you please post your code with this update?

I have this in my “image-with-text.liquid”:

{%- when 'button' -%}
              {%- if block.settings.button_label != blank -%}
                
                  {{ block.settings.button_label | escape }}
                
              {%- endif -%}
          {%- endcase -%}