We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

for loop in arry of multi lines of single line text

Solved

for loop in arry of multi lines of single line text

annab3
Shopify Partner
6 0 0
I have a MetaObject, which is connected to a MetaField. Inside it there is a multi lines of single line text.
so it's an array.. I want to run in a loop and display it.

{{ product.metafields.custom.product_features.value.product_feature }} ===>> shows me this: ["x","r","z","y"]. (It works!)

But I want to show them one by one...

I tried the following code:

{% for feature in product.metafields.custom.product_features.value.product_feature %}
    <div>
      {{ feature }}
    </div>
  {% endfor %}

But it doesn't work, pls help me 🙂
Accepted Solution (1)

Bilash
Shopify Partner
25 2 1

This is an accepted solution.

{% for feature in product.metafields.custom.product_features.value.product_feature.value %}
    <div>
      {{ feature }}
    </div>
  {% endfor %}
 
Try This code

View solution in original post

Replies 2 (2)

Bilash
Shopify Partner
25 2 1

This is an accepted solution.

{% for feature in product.metafields.custom.product_features.value.product_feature.value %}
    <div>
      {{ feature }}
    </div>
  {% endfor %}
 
Try This code
annab3
Shopify Partner
6 0 0

thank you for the quick reply! you helped me alot.
Bless you!