Shape 1 Shape 2 Shape 3

Pagination

Splitting results across multiple pages is a necessary component of theme design as you are limited to 50 results per page in any for loop in order to maintain page load times.

The paginate tag works in conjunction with the for tag to split content into numerous pages. It must wrap a for tag block that loops through an array.

{% paginate post.comments by 10 %} {% for comment in paginate.collection %} {% include "comment" %} {% endfor %} {% endpaginate %}

The by parameter is followed by an integer between 1 and 50 that tells the paginate tag how many results it should output per page.

paginate.collection

Returns an array of the items being paginated.

paginate.current_page

Returns the number of the current page.

paginate.current_offset

Returns the total number of items that are on the pages previous to the current one. For example, if you are paginating by 5 and are on the third page, paginate.current_offset would return 10

paginate.items

Returns the total number of items to be paginated. For example, if you are paginating a collection of 120 products, paginate.items would return 120.

paginate.page_size

Returns the number of items displayed per page.

paginate.pages

Returns the number of pages created by the pagination tag.

paginate.parts

Returns an array of all parts of the pagination. A part is a component used to build the navigation for the pagination.

paginate.previous

Returns the part variable for the Previous link in the pagination navigation.

{% if paginate.previous.is_link %} <a href="{{ paginate.previous.url }}">{{ paginate.previous.title }}</a> {% endif %}

paginate.next

Returns the part variable for the Next link in the pagination navigation.

{% if paginate.next.is_link %} <a href="{{ paginate.next.url }}">{{ paginate.next.title }}</a> {% endif %}

Here on the UX Team, we are so grateful for your time and we look forward to making the process of developing Kajabi themes simpler than ever before!

If you have any questions, feel free to reach out to us at themes@kajabi.com

Join Feedback Community

Enter your email below so that we can give you access to the Theme Developer Feedback Community.