image_url
Returns the CDN URL of an image.
The image_url helper can be applied to the following objects along with their src attributes:
article
collection
image
line_item
product
variant
Note
Regardless of the specified dimensions, the image size cannot exceed its original dimensions.
Parameters
Object{Object}[hash.width]{Number}: Optional.When only the width is defined, the height is computed according to the image's dimensions.[hash.height]{Number}: Optional. When only the height is defined, the width is computed according to the image's dimensions.[hash.quality]{Number}: Optional. Specifies the quality of the image after compression, default is 80 (%).returns{String}: CDN URL.
Usage
{{ image_url object [width] [height] [quality] }}
Example
{{ image_url product width=450 }}
Was this article helpful to you?