URL for image incorrect

Tourist
11 1 0

I've added an image picker, however the image picker does not include the entire path name.

 

{% unless section.settings.home-featured-image == blank %}
<img src="{{ section.settings.home-featured-image}}">
{% endunless %}
{
      "type": "image_picker",
      "id": "image",
      "label": {
        "de": "Foto",
        "en": "Image",
        "es": "Imagen",
        "fr": "Image",
        "it": "Immagine",
        "ja": "画像",
        "nl": "Afbeelding",
        "pt-BR": "Imagem",
        "zh-CN": "图片",
        "zh-TW": "圖片"
      }
    },

Example output: 

<img src="files/five-stars-01.png" class="lazypreload">
0 Likes
Highlighted
Astronaut
834 94 177

I think you need to use the img_url filter:

 

{
      "type": "image_picker",
      "id": "home_featured_image",
      "label": {
        "de": "Foto",
        "en": "Image",
        "es": "Imagen",
        "fr": "Image",
        "it": "Immagine",
        "ja": "画像",
        "nl": "Afbeelding",
        "pt-BR": "Imagem",
        "zh-CN": "图片",
        "zh-TW": "圖片"
      }
    },

Then html should be:

 

//replace 300x with the width of your image 
{% unless section.settings.home_featured_image == blank %}
<img src="{{ section.settings.home_featured_image | img_url: "300x" }}">
{% endunless %}
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes