Hi,
I have a custom metafield which populate URLs of the several images separated by comma, for example, "https://cdn.shopify.com/s/files/1.jpg, https://cdn.shopify.com/s/files/1.jpg ".
I wanted to apply img_url filter to these URLs so I wrote the code like below(example):
```
```
This code shows me the default Shopify link for no images.
I tried file_img_url filter instead but same result.
How can I get resized image link from string variable?
Regards,
Toby
Since you're not supplying a proper image object, the system does not quite understand you.
However, if you do it like this:
{% assing filename = "file.png" %}
{{ filename | file_img_url: "100x" }}
{{ filename | asset_img_url: "100x" }}
You will get something like:
//cdn.shopify.com/s/files/1/1105/5070/files/file_100x.png?737
//cdn.shopify.com/s/files/1/1105/5070/t/1/assets/file_100x.png?743
The image must be in your files / assets for this to work (the system will generate those URLs even if there is no actual file though).
User | Count |
---|---|
21 | |
18 | |
15 | |
14 | |
13 |