Paginate

Represents pagination information for paginated collections.

The paginate object contains information about a paginated collection, including the current page, available pages, and navigation links.

It is returned by tags such as product_search and experience_slot_search.

Properties

collection_size

The total number of items in the collection.

Returns: Number.

current_offset

The number of items skipped before the current page. For example, if the collection is [1, 2, 3, 4] and the offset is 2, the current page begins with [3, 4].

Returns: Number.

current_page

The page currently being displayed. This is determined by the page query parameter in the URL.

Returns: Number.

next

The URL of the next page in the collection. Returns nil when the current page is the last page.

Returns: String or nil.

page_count

The total number of pages in the collection.

Returns: Number.

page_size

The maximum number of items displayed on each page.

Returns: Number.

parts

An array of pagination parts representing the available page links. When there are many pages, the array automatically includes ellipses where appropriate.

This property is primarily used when building a custom pagination component.

Returns: Array.

previous

The URL of the previous page in the collection. Returns nil when the current page is the first page.

Returns: String or nil.

Example

{% product_search page_size: 12 %}
  <p>
    Page {{ paginate.current_page }}
    of {{ paginate.page_count }}
  </p>

  <p>
    Showing {{ paginate.collection_size }} results
  </p>

  {{ paginate | default_pagination }}
{% endproduct_search %}

On this page