# Iteration (Lists)

## For Loop

To loop through an array — such as a list of products or product tags — you can use the `li-for` tag. This tag automatically duplicates the associated element for each item in the array. Within the loop, you have direct access to the current object being iterated over.

For example, when looping through a list of products, you can access individual product properties using dot notation (e.g. `product.price`).

{% columns %}
{% column %}
{% code title="Webflow" fullWidth="false" %}

```
<div li-for="product in collection.products">
    <div li-object="product.price"></div>
</div>
```

{% endcode %}
{% endcolumn %}

{% column %}
{% code title="Shopify" fullWidth="false" %}

```html
{% for product in collection.products %}
   <div>{{ product.price }}</div>
{% endfor %}
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

<figure><img src="/files/JrGJm1afdJCORTXZpX4T" alt=""><figcaption></figcaption></figure>

For positionin&#x67;**,** you can use the `:inside` modifier. The converted code will look like this:

{% columns %}
{% column %}
{% code title="Webflow" fullWidth="false" %}

```
li-for:inside = product in collection.products
```

{% endcode %}
{% endcolumn %}

{% column %}
{% code title="Shopify" fullWidth="false" %}

```html
<div>
   {% for product in collection.products %}
      {{ product.title }}
   {% endfor %}
</div>
```

{% endcode %}
{% endcolumn %}
{% endcolumns %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.liquiflow.app/liquid-attributes/iteration-lists.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
