If I have this:
"attributes": {
"color": [
{
"id": 29907472,
"name": "Green",
"displayType": 5,
"image": "/_assets/img/products/tshirt-green.png",
"price": null
},
{
"id": 29907473,
"name": "Turquoise",
"displayType": 5,
"image": "",
"price": null
},
{
"id": 29907474,
"name": "Teal",
"displayType": 5,
"image": "",
"price": null
}
]
},
and want to output only the name of the color in liquid, how would I need to do that? I tried
{% for name in attributes.color %}
{{ name }}
{% endfor %}
but I only get this as the output: [id, 29907472][name, Green][displayType, 5][image, /_assets/img/products/tshirt-green.png][price, ] [id, 29907473][name, Turquoise][displayType, 5][image, ][price, ] [id, 29907474][name, Teal][displayType, 5][image, ][price, ]
Where am I wrong? Sorry, beginner with liquid.