php-liquid
php-liquid copied to clipboard
for loop working incorrect with "in deep variable"
If I use for with "deep variable", the for loop working incorrect. Example
{% for product in collections[13].products %}
<li>
<span><a href="{{ product.url }}">{{ product.id }}: {{ product.title }}</a></span>
</li>
{% endfor %}
My mean is loop all products in collections's index 13, but it loop collections, same case
{% for product in collections %}
<li>
<span><a href="{{ product.url }}">{{ product.id }}: {{ product.title }}</a></span>
</li>
{% endfor %}
When I use bellow, it working well
{% assign products = collections[13].products %}
{% for product in products %}
<li>
<span><a href="{{ product.url }}">{{ product.id }}: {{ product.title }}</a></span>
</li>
{% endfor %}
Please check! Sorry my bad english
No worries! Thanks for the report.
Please stick to {% assign ... %}
for now. We'll see if we can fix this by the next release.
Thank you so much