​Pagination for pixolino pages (BETA feature)

A page with render mode “Blog” may contain more article teasers, than one single page can display. This page will be split into multiple pages with an individual set of article teasers on each. For navigating between those pages, a pagination navigation is required.

Parameters for fx_page.pagination

  1. The actual page. This could be either the pixolino page object (available in the variable page) or a page slug (represented by a string). if this page does not contain content, which is paginatable, no pagination navigation will be displayed.
  2. The number of elements the pagination navigation should contain by maximum.
  3. A boolean value (true or false), which indicates whether the first and the last page should be displayed. If true, the first and last pages are displayed additionally to the number of elements configured in parameter 2.
  4. The application context (available in the variable _context). This context is required and should not be changed.

Example of a pagination call inside a template

{{ fx_page.pagination(page, 10, true, _context) }}

This code will render 12 <li>s at maximum. If the current page is 12 (with 30 pages available) it will render links to the pages 1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 30.

Generated HTML code

The pagination navigation ist rendered as unsorted list <ul>. Inside each <li> a navigational link <a> is placed. If the <li> represents the active page, the <a> is replaced by a <span>.

Be aware that the navigation component does not render a <nav> tag. You should place the navigation function always inside a <nav> tag within your template's code!

Example of generated HTML code

<ul class="fx_pagination">
    <li><a href="page">1</a></li>
    <li><span>2</span></li>
    <li><a href="page/3">3</a></li>
    <li><a href="page/4">4</a></li>
</ul>