Last active
December 6, 2023 00:41
-
-
Save lukearmstrong/5553488 to your computer and use it in GitHub Desktop.
Shopify - Show links to all pages in pagination, gets rid of the "..."
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
<div id="pagination"> | |
<ul> | |
{% if paginate.previous %} | |
<li>{{ paginate.previous.title | link_to: paginate.previous.url }}</li> | |
{% endif %} | |
{% for i in (1..paginate.pages) %} | |
{% if paginate.current_page == i %} | |
<li>{{ i }}</li> | |
{% else %} | |
<li><a href="?page={{ i }}">{{ i }}</a></li> | |
{% endif %} | |
{% endfor %} | |
{% if paginate.next %} | |
<li>{{ paginate.next.title | link_to: paginate.next.url }}</li> | |
{% endif %} | |
</ul> | |
<p> | |
Showing items {{ paginate.current_offset | plus: 1 }}-{% if paginate.next %}{{ paginate.current_offset | plus: paginate.page_size }}{% else %}{{ paginate.items }}{% endif %} of {{ paginate.items }}. | |
</p> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment