Created
May 15, 2018 01:08
-
-
Save khoipro/e33dd0e893ef49212c282f69d00d3742 to your computer and use it in GitHub Desktop.
Shopify - Custom Page Pagination
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
| <ul class="pagination__inner relative align-l mv1 pl0 f fw aic"> | |
| {% if current_page > 1 %} | |
| {% assign previous_page = current_page | minus:1 %} | |
| <li class="pagination__arrow pagination__arrow--previous mr05 inline-block"> | |
| <a href="{{ page.url }}?page={{ previous_page }}" class="inline-block relative" title="Previous">Previous</a> | |
| </li> | |
| {% endif %} | |
| {% for i in (1..total_pages) %} | |
| <li class="pagination__page mh025 inline-block{% if current_page == i %} is-active{% endif %}"> | |
| <a href="{{ page.url }}{% if i != 1 %}?page={{ i }}{% endif %}" class="medium inline-block align-c" title="">{{ i }}</a> | |
| </li> | |
| {% endfor %} | |
| {% if current_page < total_pages | minus:1 %} | |
| {% assign next_page = current_page | plus:1 %} | |
| <li class="pagination__arrow pagination__arrow--next ml025 inline-block"> | |
| <a href="{{ page.url }}?page={{ next_page }}" class="inline-block relative" title="Next">Next</a> | |
| </li> | |
| {% endif %} | |
| </ul> | |
| {%- assign previous_page = nil %} | |
| {%- assign nex_page = nil -%} |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use: