Loop through items in a forloop only if 'x' is a unique value

lacedwing
New Member
1 0 0

Hi there,

Using forloop.index0 Is it possible to  loop through items in a forloop only if x is a unique value?  If so, how should I go about accomplishing this?

Thank you for your help!

 

Best,

LW

 

 

0 Likes
tony5280
Shopify Partner
61 6 18

Maybe I'm completely misunderstanding, but have you tried

{% if x == 1 %}
	{% for i in r %}
	{% endfor %}
{% endif %}

If possible, it's best to test for your exclusion before stepping into the loop. Of course, you could test variables while inside the loop, but if you don't need the rest of the loop, it's best to let the server work on helping customers instead

 

0 Likes