part
A part in the navigation for pagination.
{
"is_link": true,
"title": "2",
"url": "/collections/all?page=2"
}
Example
{
"is_link": true,
"title": "2",
"url": "/collections/all?page=2"
}You can create a pagination navigation by iterating over each part of a paginate object.
{% paginate collection.products by 5 -%}
{% for part in paginate.parts -%}
{% if part.is_link -%}
{{ part.title | link_to: part.url}}
{%- else -%}
<span>{{ part.title }}</span>
{% endif %}
{%- endfor %}
{%- endpaginate %}
Code
{% paginate collection.products by 5 -%}
{% for part in paginate.parts -%}
{% if part.is_link -%}
{{ part.title | link_to: part.url}}
{%- else -%}
<span>{{ part.title }}</span>
{% endif %}
{%- endfor %}
{%- endpaginate %}Data
{
"collection": {
"products_count": 19
}
}Output
<span>1</span>
<a href="/services/liquid_rendering/resource?page=2" title="">2</a>
<a href="/services/liquid_rendering/resource?page=3" title="">3</a>
<a href="/services/liquid_rendering/resource?page=4" title="">4</a>
Output
<span>1</span>
<a href="/services/liquid_rendering/resource?page=2" title="">2</a>
<a href="/services/liquid_rendering/resource?page=3" title="">3</a>
<a href="/services/liquid_rendering/resource?page=4" title="">4</a>Was this section helpful?