Marketpath Pagination Package

Marketpath provides the following pagination options for use in your sites.

Usage

{%- include '/marketpath/paging/_pagination'
   collection:my_collection
   paging_style:'list'
   page_query_param:'page'
   num_next_pages:3
   show_prev_and_next:true
   show_first_and_last:true
   page_item_class:"page-item"
   page_link_class:"page-link" -%}

Parameters

  • collection - any list object
  • paging_style - the style of paging to use: values are "list", "select", and "basic" (default is "list")
  • page_query_param - the query parameter to use for the current page (defaults to "page")
  • num_next_pages - the number of pages to link to on either side of the current page. -1 will link to all pages (default is 3)
  • show_prev_and_next - if true, will show the previous and next links (defaults to true)
  • show_first_and_last - if true, will show the first and last pages even if they are not within num_next_pages (defaults to true)
  • exclude_styles - if true, will not add default styles. (defaults to false)
  • page_item_class - the class to use for li items (default is null)
  • page_link_class - the class to use for page links (default is null)

Paging Styles & Examples

Basic

List

{% include "/components/marketpath/pagination/_pagination" collection:posts paging_style:'list' %}

Select Dropdown

{% include "/components/marketpath/pagination/_pagination" collection:posts paging_style:'select' %}

Basic

{% include "/components/marketpath/pagination/_pagination" collection:posts paging_style:'basic' %}

Formatted

List with Bootstrap

{% include "/components/marketpath/pagination/_pagination" collection:posts paging_style:'list' page_item_class:'page-item' page_link_class:'page-link' %}