Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Image picker showing "no image" when selecting image

Solved

Image picker showing "no image" when selecting image

asahic
Shopify Partner
3 0 0

Hey, I'm trying to create a image picker inside the main-product section on a Dawn template.

I'm using these codes:

In the {% schema %} section, I'm using this one:

 

 

 {
  "type": "image_picker",
  "name": "metodo pagos",
  "limit": 1,
  "settings": [
    {
      "type": "image_picker",
      "id": "upload_image",
      "label": "Upload a image",
      "info": "aquí va la imagen"
    }
  ]
},

 

 

and this one: 

 

 

 {%- when 'image_picker' -%}
      <div class="image__picker" {{ block.shopify_attributes }}>
    <img src="{{ section.settings.upload_image | img_url: '100x'}}" style="width:100%; height:auto; display:block; border:1px solid #ddd;" class="img-responsive"/>
  </div>

 

 

 

When customizing my theme, it shows the block correctly and allows me to choose the image, but it keeps showing the "no image" message

 

image picker.JPG

 
Thanks for your help, I'm just starting to learn code and I'm also new to liquid, so I'm a bit lost.
Accepted Solution (1)

wattsmork
Shopify Partner
26 8 7

This is an accepted solution.

Hello @asahic ,

 

Please use block.settings.upload_image instead of section.settings.upload_image.

 

Hope this helps you,

Regards

Morgan

View solution in original post

Replies 2 (2)

wattsmork
Shopify Partner
26 8 7

This is an accepted solution.

Hello @asahic ,

 

Please use block.settings.upload_image instead of section.settings.upload_image.

 

Hope this helps you,

Regards

Morgan

asahic
Shopify Partner
3 0 0

Thanks!!! This solved my problem!