Skip to content

Instantly share code, notes, and snippets.

@derekjones
Last active December 23, 2015 20:09
Show Gist options
  • Save derekjones/6687318 to your computer and use it in GitHub Desktop.
Save derekjones/6687318 to your computer and use it in GitHub Desktop.
ExpressionEngine pagination with ellipsis
{paginate}
{pagination_links}
<ul>
{previous_page}
<li><a href="{pagination_url}" class="page-previous">&lt;</a></li>
{/previous_page}
{first_page}
<li><a href="{pagination_url}" class="page-first">1</a> &hellip;</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>&hellip; <a href="{pagination_url}" class="page-last">{total_pages}</a></li>
{/last_page}
{next_page}
<li><a href="{pagination_url}" class="page-next">&gt;</a></li>
{/next_page}
</ul>
{/pagination_links}
{/paginate}
@derekjones
Copy link
Author

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 >

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment