skip to Main Content

I have defined this in schema.json :

{
        "type": "image",
        "id": "zeva_image_1",
        "label": "Image"
      }

And i need to use it in a template and i am doing it like this :

<img src="{{ settings.zeva_image_1 | asset_url }}" />

But its not working out for me.

can anyone help in correcting this ?

2

Answers


  1. 1st Method

    If you want to use the type “image” then you should put the file extension too.

    {
      "type": "image",
      "id": "zeva_image_1.jpg",
      "label": "Image"
    }
    

    and

    {{ 'zeva_image_1.jpg' | asset_url | img_tag }}
    

    2nd Method

    Also you can use the “image-picker” type like

       {
        "type": "image_picker",
        "id": "zeva_image_1",
        "label": "Image"
      }
    

    with

    {{ settings.zeva_image_1 | img_url: 'master' | img_tag }}
    
    Login or Signup to reply.
  2. Maybe It help you

    <img src="{{ section.settings.zeva_image_1 | img_url: 'master' }}" />
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search