Last active
September 26, 2019 14:58
-
-
Save shopifypartners/192c74168abb5c23893495b0ed468b02 to your computer and use it in GitHub Desktop.
Example of a product gallery that has been updated to support for media
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for media in product.media %} | |
<div> | |
{% capture img_id %}FeaturedImage-{{ section.id }}-{{ media.id }}{% endcapture %} | |
{% case media.media_type %} | |
{% when 'image' %} | |
<img id="{{ img_id }}" | |
class="feature-row__image" | |
src="{{ media | img_url: '300x300' }}" | |
data-widths="[180, 360, 540, 720, 900, 1080, 1296, 1512, 1728, 2048]" | |
data-aspectratio="{{ media.aspect_ratio }}" | |
data-sizes="auto" | |
tabindex="-1" | |
alt="{{ media.alt | escape }}"> | |
{% when 'external_video' %} | |
{{ media | external_video_tag }} | |
{% when 'model' %} | |
{{ media | model_viewer_tag }} | |
{% when 'video' %} | |
{{ media | video_tag }} | |
{% else %} | |
{{ media | media_tag }} | |
{% endcase %} | |
</div> | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment