How to put a image in custom liquid
Topic summary
A user asks how to add an image using custom Liquid code in their Shopify store.
Solutions provided:
- Use the standard HTML
<img>tag with thesrcattribute pointing to the image URL - For images stored in Shopify’s asset directory, use the
asset_urlfilter to generate the full URL path - Additional attributes like
width,height, andclasscan be included for styling
Code examples shared:
<img src="{{ 'image-file.jpg' | asset_url }}" alt="Description">
Important note: The asset_url filter only works for files stored in the store’s assets directory. For external images, use the direct URL as the src value.
You can type above code like this. And replace your image URL as the src value.
Hello there
To add an image in a custom Liquid template, you can use the img tag and specify the source of the image using the src attribute. Here’s an example:
You can also include other attributes, such as the width and height of the image, or specify a class for styling using the class attribute.
If you want to use an image file that is stored in your Shopify store’s assets, you can use the asset_url filter to generate the full URL of the image file.
Note that the asset_url filter only works for files that are stored in the assets directory of your store.
hope this helps