Stay up to date

Developer changelog

Themes

The Pages global Liquid object is now iterable

Effective May 10, 2021

Update

You can now iterate through the global Liquid Pages object, instead of only being able to directly reference known pages through their handle. This allows you to access a paginated pages listing of up to 50 items at a time and produce HTML that is conditional to the page data that is available.

{% comment %} 
    Before: Create a list of known pages in a store.  
{% endcomment %}

<ul>
    <li>{{pages.about.title}}</li>
    <li>{{pages.contact.title}}</li>
</ul>

{% comment %} 
    Now: Create a paginated list of pages that are present in a store. 
{% endcomment %}

<ul>
{%- paginate pages by 50 \-%}
    {%- for currentPage in pages -%}
        <li>{{currentPage.title}}</li>
    {%- endfor -%}
    {{ paginate | default\_pagination: next: 'Older', previous: 'Newer' }} 
{%- endpaginate \-%}
</ul>