model
A 3D model uploaded as product media.
Properties
The media type of the model. Always returns
model
.ExampleFilter for media of a specific typeYou can use the
property with the
where
filter to filter theproduct.media
array for all media of a desired type.{% assign models = product.media | where: 'media_type', 'model' %}{% for model in models %}{{- model | model_viewer_tag }}{% endfor %}{% assign models = product.media | where: 'media_type', 'model' %} {% for model in models %} {{- model | model_viewer_tag }} {% endfor %}
{ "product": { "media": [ { "media_type": "model" } ] } }
Output
<model-viewer src="//polinas-potent-potions.myshopify.com/cdn/shop/3d/models/o/eb9388299ce0557c/WaterBottle.glb?v=0" camera-controls="true" style="--poster-color: transparent;" data-shopify-feature="1.12" alt="Potion bottle" poster="//polinas-potent-potions.myshopify.com/cdn/shop/products/WaterBottle_small.jpg?v=1655189057"></model-viewer>The position of the model in the
product.media
array.- sourcesarray of model_source
The source files for the model.
Anchor to
{
"alt": "Potion bottle",
"id": 22064203137089,
"media_type": "model",
"position": 1,
"preview_image": {},
"sources": []
}
{
"alt": "Potion bottle",
"id": 22064203137089,
"media_type": "model",
"position": 1,
"preview_image": {},
"sources": []
}
Was this section helpful?