skip to Main Content

Im having issue with simply adding an image to the provided custom html field within the shopify store front. Im trying to utalize as much as the theme has to offer, but I am finding a few nuances that I am struggling to find solutions to.

here is what I’m working with.

<img src="{{'cj.png' | /assets/cj.png}} />

Everything that I have tried shows up as a broken image.
thanks!

2

Answers


  1. {{ 'cj.png' | asset_folder | img_tag }}
    

    This will output full image tag with correct path.

    Also you can get the image url. Click on the image in your asset folder in theme files. It will show the image. Right click and copy image address.

    Login or Signup to reply.
  2. I had better luck with this syntax:

    {{ 'image.png' | asset_img_url: '220x' | img_tag }}

    See the asset_img_url section of https://help.shopify.com/en/themes/liquid/filters/url-filters for more infromation about asset_img_url.

    Note that like the answer above, this applies to liquid templates.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search