Created
September 13, 2013 14:23
-
-
Save cedricdekimpe/6551431 to your computer and use it in GitHub Desktop.
Custom pagination with LocomotiveCMS
This file contains 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
<nav class="pagination"> | |
<ul> | |
{% if paginate.current_page > 1 %} | |
<li> | |
<a href="?page=1">first</a> | |
</li> | |
{% endif %} | |
{% if paginate.previous_page %} | |
<li> | |
<a href="?page={{paginate.previous_page}}" rel="prev">prev.</a> | |
</li> | |
{% endif %} | |
{% for part in paginate.parts %} | |
<li class="page{% if part.title == paginate.current_page %} active{% endif %}"> | |
<a href="{{ part.url }}">{{ part.title }}</a> | |
</li> | |
{% endfor %} | |
{% if paginate.next_page %} | |
<li> | |
<a href="?page={{paginate.next_page}}" rel="next">next</a> | |
</li> | |
{% endif %} | |
{% if paginate.current_page < paginate.total_pages %} | |
<li> | |
<a href="?page={{paginate.total_pages}}">last</a> | |
</li> | |
{% endif %} | |
</ul> | |
</nav> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment