Last active
February 8, 2018 10:23
-
-
Save arlopezg/45b5e25c6b9df33faea1f91664741a57 to your computer and use it in GitHub Desktop.
Set up the data collection to be paginated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% paginate collection.products by 3 %} | |
| <!-- Start the pagination and tells Ajaxify how many items to load at once --> | |
| <div class="EndlessScroll"> | |
| <!-- Ajaxify will insert the items in this element --> | |
| {% for product in collection.products %} | |
| {% include 'product-grid-item' %} | |
| {% endfor %} | |
| <!-- Regular data collection loop --> | |
| {% if paginate.next %} | |
| <div class="pagination"> | |
| <a href="{{ paginate.next.url }}">Loading More</a> | |
| </div> | |
| {% endif %} | |
| <!-- Tells Ajaxify what to show when a new page is available --> | |
| <!-- Modifying this part is optional, it works fine out of the box --> | |
| </div> | |
| {% endpaginate %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment