Last active
December 23, 2015 20:09
-
-
Save derekjones/6687318 to your computer and use it in GitHub Desktop.
ExpressionEngine pagination with ellipsis
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} | |
{pagination_links} | |
<ul> | |
{previous_page} | |
<li><a href="{pagination_url}" class="page-previous"><</a></li> | |
{/previous_page} | |
{first_page} | |
<li><a href="{pagination_url}" class="page-first">1</a> …</li> | |
{/first_page} | |
{page} | |
<li><a href="{pagination_url}" class="page-{pagination_page_number} {if current_page}active{/if}">{pagination_page_number}</a></li> | |
{/page} | |
{last_page} | |
<li>… <a href="{pagination_url}" class="page-last">{total_pages}</a></li> | |
{/last_page} | |
{next_page} | |
<li><a href="{pagination_url}" class="page-next">></a></li> | |
{/next_page} | |
</ul> | |
{/pagination_links} | |
{/paginate} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a sample of native comment and entry pagination in ExpressionEngine that will output using ellipsis to show the first and last pages when necessary along with the numeric page links surrounding your current page, e.g.:
< 1 2 3 4 … 9 >