Solved

Add an image "Block" to use within a Section - Dawn theme.

byClaireWebb
Tourist
9 0 1

I would like to add an image "Theme Block" that can be used within a section. Can I achieve this by adding a new "Section" to my code? I want to add a small image below the text in this "Text with Image" section. Thanks!

byClaireWebb_0-1690561603023.png

 

Accepted Solution (1)

Anthony_David_
Shopify Partner
417 46 106

This is an accepted solution.

Hello @byClaireWebb 

Please check the below step:

1: go to the file image-with-text

2. go the the bottom scheme and look for "type": "button", and add the below code above it. (Check the screenshot below)

    {
      "type": "image",
      "name": "image",
      "settings": [
        {
          "type": "image_picker",
          "id": "image",
          "label": "Select Image"
        }
      ]
    },

Anthony_David__0-1690571978936.png


Step 2: look for {%- when 'button' -%} and add the below code above it (Find the attached screenshot)

            {%- when 'image' -%}
              <div class="image-with-text__text-video rte {{ block.settings.text_style }}" {{ block.shopify_attributes }}>
                <img src="{{ block.settings.image | img_url: 'master' }}">
              </div>

 

Anthony_David__1-1690572064486.png


Now go to customise hopefully you should see the image block.

Thanks

 

 




Theme customization | Design | Shopify App Consultant
Have Any Questions? Whatsapp +1 (341) 241-4263
Based in United States

View solution in original post

Replies 7 (7)

Anthony_David_
Shopify Partner
417 46 106

Will share a video for this... @byClaireWebb 

Theme customization | Design | Shopify App Consultant
Have Any Questions? Whatsapp +1 (341) 241-4263
Based in United States

shreyhweb
Shopify Partner
631 109 114

@byClaireWebb 

 

Yes it is possible thing by custom coding in your section.

 

if you want to further information about it then You can contact us.

- If You Find Our Solution Helpful Please Like And Mark As Accepted!
- Sip, savor, and support – your Coffee Tip helps us keep coding.❤️
- If You Want To Further Discussion. Then Contact - info@shreyhsoftsolutions.com

Anthony_David_
Shopify Partner
417 46 106

This is an accepted solution.

Hello @byClaireWebb 

Please check the below step:

1: go to the file image-with-text

2. go the the bottom scheme and look for "type": "button", and add the below code above it. (Check the screenshot below)

    {
      "type": "image",
      "name": "image",
      "settings": [
        {
          "type": "image_picker",
          "id": "image",
          "label": "Select Image"
        }
      ]
    },

Anthony_David__0-1690571978936.png


Step 2: look for {%- when 'button' -%} and add the below code above it (Find the attached screenshot)

            {%- when 'image' -%}
              <div class="image-with-text__text-video rte {{ block.settings.text_style }}" {{ block.shopify_attributes }}>
                <img src="{{ block.settings.image | img_url: 'master' }}">
              </div>

 

Anthony_David__1-1690572064486.png


Now go to customise hopefully you should see the image block.

Thanks

 

 




Theme customization | Design | Shopify App Consultant
Have Any Questions? Whatsapp +1 (341) 241-4263
Based in United States
byClaireWebb
Tourist
9 0 1

Thank you!

conceptmart
Visitor
3 0 0

hi, the image is little blurry, and can we make this image size smaller , it's width and height means?

conceptmart
Visitor
3 0 0

and one this also, this image border is a little grey, can we remove that also?

Felisha_Singh
Tourist
4 0 0

Thank you, works like a charm!