img_ tagDeprecated
Code
{{ product | img_tag }}Output
Output
<img src="//polinas-potent-potions.myshopify.com/cdn/shop/files/science-beakers-blue-light-new_small.jpg?v=1683744744" alt="" />Optional parameters
The filter accepts 3 unnamed parameters, separated by commas, to specify the alt and class attributes, and the
size of the image. Because the parameters are read in that order, you must include a value for each parameter before the last
parameter you want to specify. If you don't want to include a parameter that precedes one that you do want to include, then
you can set the value to an empty string.
The size attribute of the filter can't be used in conjunction with the filter.
If both are used, then the filter will override the size parameter of the filter.
The size attribute of the filter can't be used in conjunction with the filter.
If both are used, then the filter will override the size parameter of the filter.
Note: The <code>size</code> attribute of the <code><span class="PreventFireFoxApplyingGapToWBR">img<wbr/>_tag</span></code> filter can't be used in conjunction with the <a href="/docs/api/liquid/filters/img_url"><code><span class="PreventFireFoxApplyingGapToWBR">img<wbr/>_url</span></code> filter</a>. If both are used, then the <code><span class="PreventFireFoxApplyingGapToWBR">img<wbr/>_url</span></code> filter will override the <code>size</code> parameter of the <code><span class="PreventFireFoxApplyingGapToWBR">img<wbr/>_tag</span></code> filter.
Code
{{ product | img_tag: 'image alt text', '', '450x450' }}Output
Output
<img src="//polinas-potent-potions.myshopify.com/cdn/shop/files/science-beakers-blue-light-new_450x450.jpg?v=1683744744" alt="image alt text" class="" />