Skip to content

Instantly share code, notes, and snippets.

@croxton
Created October 12, 2012 17:53
Show Gist options
  • Save croxton/3880523 to your computer and use it in GitHub Desktop.
Save croxton/3880523 to your computer and use it in GitHub Desktop.
{!-- Standard pagination, e.g. /P15 --}
{!-- Works with match, against and offset params too --}
{!-- Use prefix="my_prefix" if you need a prefix for the pagination tag pairs / variables --}
{exp:stash:get_list
name="my_channel"
limit="5"
paginate="bottom"
}
<h3>{absolute_count}: {title}</h3>
{paginate}
{pagination_links}
<ul>
{first_page}
<li><a href="{pagination_url}" class="page-first">First Page</a></li>
{/first_page}
{previous_page}
<li><a href="{pagination_url}" class="page-previous">Previous Page</a></li>
{/previous_page}
{page}
<li><a href="{pagination_url}" class="page-{pagination_page_number} {if current_page}active{/if}">{pagination_page_number}</a></li>
{/page}
{next_page}
<li><a href="{pagination_url}" class="page-next">Next Page</a></li>
{/next_page}
{last_page}
<li><a href="{pagination_url}" class="page-last">Last Page</a></li>
{/last_page}
</ul>
{/pagination_links}
{/paginate}
{/exp:stash:get_list}
{!-- Query string style pagination, e.g. ?page=P15 --}
{exp:stash:get_list
name="my_channel"
limit="5"
paginate="bottom"
paginate_base="site/test"
paginate_param="page"
}
<h3>{absolute_count}: {title}</h3>
{paginate}
{pagination_links}
<ul>
{first_page}
<li><a href="{pagination_url}" class="page-first">First Page</a></li>
{/first_page}
{previous_page}
<li><a href="{pagination_url}" class="page-previous">Previous Page</a></li>
{/previous_page}
{page}
<li><a href="{pagination_url}" class="page-{pagination_page_number} {if current_page}active{/if}">{pagination_page_number}</a></li>
{/page}
{next_page}
<li><a href="{pagination_url}" class="page-next">Next Page</a></li>
{/next_page}
{last_page}
<li><a href="{pagination_url}" class="page-last">Last Page</a></li>
{/last_page}
</ul>
{/pagination_links}
{/paginate}
{/exp:stash:get_list}
@eheiser
Copy link

eheiser commented Nov 24, 2013

This link https://github.com/croxton/Stash/tree/feature-pagination is dead now. Is there any place to see the stash code for the setting of the stash lists?

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