Skip to content

Instantly share code, notes, and snippets.

@curtisblackwell
Created August 22, 2011 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curtisblackwell/1162180 to your computer and use it in GitHub Desktop.
Save curtisblackwell/1162180 to your computer and use it in GitHub Desktop.
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