Created
November 21, 2013 20:26
-
-
Save kyleaparker/7588995 to your computer and use it in GitHub Desktop.
Shopify: Show all numbers in 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
{% assign count = paginate.pages %} | |
{% for part in (1..count) %} | |
<li {% if paginate.current_page == part %}class="active"{% endif %}><a href="{{ collection.url }}?page={{ forloop.index }}">{{ forloop.index }}</a></li> | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While I appreciate this simplistic approach, I found an issue with the search page. Since the search adds a
q=search
parameter, the query parameter would be lost when changing pages since thehref
is hardcoded in your example.I published an updated gist that retains the query parameter by using the generated
page.next.url
links:https://gist.github.com/IliasDeros/10cbdf4b6ba9e610ae82d725bff7d56f