media
The following types of objects can be represented by an abstract media object:
The media object can be returned through the product.media array.
You can use media helpers to generate URLs and display media. To learn how to use product media in your theme, refer to Supporting Product Media.
Note
Each media type possesses specific properties beyond the general media properties. Refer to each type's documentation to understand these additional features.
Properties
The alt text of the media.
The ID of the media.
The type of the media.
| Possible values |
|---|
| image |
| video |
| external_video |
Example
Filter Specific Types of Media
You can use the media_type property and the where helper to filter the product.media array for media of the specific type you want.
{{assign 'demo_images' (where product.media 'media_type' 'image')}}
{{#each demo_images as |image|}}
{{image_tag (image_url image width=400)}}
{{/each}}
The position of the media in the product.media array.
The preview image of the media.
Was this article helpful to you?