paging

Generate a list of page navigation links for a thumb_list, or any other function tag that supports the pgnum param

Example

[%paging limit:'3'%]
    [%param *previous_page%]
        <li class="page-item"><a class="page-link" href="[@url@]" aria-label="Go back one page"><i class="fa fa-chevron-left" aria-hidden="true"></i></a></li>
    [%/param%]
    [%param *goback_pages%]
        <li class="page-item"><a class="page-link" href="[@url@]" aria-label="Go to page [@page@]">[@page@]</a></li>
    [%/param%]
    [%param *current_page%]
        <li class="page-item active"><a class="page-link" href="[@url@]" aria-label="Current page">[@page@]</a></li>
    [%/param%]
    [%param *gonext_pages%]
        <li><a href="[@url@]" class="page-link" aria-label="Go to page [@page@]">[@page@]</a></li>
    [%/param%]
    [%param *next_page%]
        <li class="page-item"><a class="page-link" href="[@url@]" aria-label="Go forward one page"><i class="fa fa-chevron-right" aria-hidden="true"></i></a></li>
    [%/param%]
[%/paging%]

Usage

The paging function can be used to generate and style a list of next/current/previous page links for a category or content page, or anywhere paging can occur. This function is not compatible with the list function, refer to the pagination function if using.

Parameters

Name Options Description
`limit:''` Integer or b@se tag Set the max number of page links displayed before and after the current page link
`qs_name:''` String or b@se tags Set the name of the URL query used to indicate the current page. E.g. if `qs_name:'page'` is set, the paging URL would be `/?page=2`. Will default to `pgnum` if omitted. Please note, changing this will break pagination unless you also update the corresponding thumb_list or function being paged to pass through the new query string as the pgnum param value
`*current_page` HTML & b@se tags Renders in the list when the current page matches the value in the `current_page_num:''` param
`*goback_pages` HTML & b@se tags Renders in the list when there is a previous page to the current page. Used to link to the previous page
`*gonext_pages` HTML & b@se tags Renders in the list when there is another page after the current page. Used to link to the next page
`*next_page` HTML & b@se tags Renders the link to the next page after the currently selected page
`*previous_page` HTML & b@se tags Renders the link to the next page after the currently selected page

Data Tags (current_page, goback_pages, gonext_pages, next_page, previous_page)

Name Example Description
`[@page@]` 2 Page number
`[@url@]` /accessories/?pgnum=2 Relative URL of current page, with paging query string

Was this article useful?

Be notified when this page is updated. Optional.