Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pagination snippet using [Bjørn Børresen's AB Pagination](http://www.addonbakery.com/) and [Mark Croxton's Switchee](http://devot-ee.com/add-ons/switchee)
{!--
This will only work if embedded in another switchee tag pair.
If it's not embedded, change the {switchee} tags to {exp:switchee}.
--}
{paginate}
{switchee variable="{abp_has_previous}"}
{case value="1"}
<a class="paginate_more" href="{abp_previous_link}">&larr;</a>
{/case}
{case value=""}
<span class="paginate_end">&larr;</span>
{/case}
{/switchee}
{abp_pages padding="5"}
{switchee variable="{abp_is_current}"}
{case value="1"}
<span class="paginate_current">{abp_num}</span>
{/case}
{case value=""}
<a href="{abp_link}">{abp_num}</a>
{/case}
{/switchee}
{/abp_pages}
{switchee variable="{abp_has_next}"}
{case value="1"}
<a class="paginate_more" href="{abp_next_link}">&rarr;</a>
{/case}
{case value=""}
<span class="paginate_end">&rarr;</span>
{/case}
{/switchee}
{/paginate}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment