---
title: "Pagination"
manual: "Yellowpages2"
version: "10.0"
permalink: "https://docs.typo3.org/permalink/jweiland/yellowpages2:pagination@10.0"
source: "AdministratorManual/Pagination/Index.rst"
rendered: "2026-11-20T15:36:35+00:00"
---

[https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/GeneralConventions/FileStructure.html#includes-rst-txt](https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/GeneralConventions/FileStructure.html#includes-rst-txt)

# Pagination {#pagination}

`yellowpages2` uses TYPO3 Core's `SimplePagination` to navigate through records with `first`,
`previous`, `next`, and `last` buttons. If you need something more complex, like
`1, 2 ... 56, 57, 58 ... 123, 124`, use another pagination library or build your own. The following
steps show how to plug in Georg Ringer's `numbered_pagination` extension instead.

1.  Install `numbered_pagination`

    Install and activate `numbered_pagination` extension from Georg
    Ringer. Please check in your SitePackage extension that
    `numbered_pagination` is set as a dependency and will be loaded
    before `yellowpages2` and your SitePackage.
1.  Change pagination class in TypoScript

    ```typoscript
    plugin.tx_yellowpages2.pageBrowser.class = GeorgRinger\NumberedPagination\NumberedPagination
    ```
1.  Change path to yellowpages2 partials

    Set constant `partialRootPath` to a location within your SitePackage:

    ```typoscript
    plugin.tx_yellowpages2.view.partialRootPath = EXT:site_package/Resources/Private/Extensions/Yellowpages2/Partials/
    ```
1.  Create Pagination template

    Create file `Resources/Private/Extensions/Yellowpages2/Partials/Component/Pagination.html`
    with example content from numbered_pagination
    [https://github.com/georgringer/numbered_pagination/blob/master/Resources/Private/Partials/Pagination.html](https://github.com/georgringer/numbered_pagination/blob/master/Resources/Private/Partials/Pagination.html)

    ```html
    <html lang="en"
          xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
          data-namespace-typo3-fluid="true">

    <nav aria-label="{f:translate(key: 'pageBrowser', extensionName: 'yellowpages2')}">
        <ul class="pagination">
            <f:if condition="{pagination.previousPageNumber} && {pagination.previousPageNumber} >= {pagination.firstPageNumber}">
                <li class="page-item previous">
                    <a class="page-link" href="{f:uri.action(action:actionName, arguments:{currentPage: pagination.previousPageNumber})}" title="{f:translate(key:'pagination.previous')}">
                        {f:translate(key:'widget.pagination.previous', extensionName: 'fluid')}
                    </a>
                </li>
            </f:if>
            <f:if condition="{pagination.hasLessPages}">
                <li class="page-item disabled"><span class="page-link">…</span></li>
            </f:if>
            <f:for each="{pagination.allPageNumbers}" as="page">
                <li class="page-item{f:if(condition: '{page} == {paginator.currentPageNumber}', then:' active')}">
                    <a class="page-link" href="{f:uri.action(action:actionName, arguments:{currentPage: page})}">{page}</a>
                </li>
            </f:for>
            <f:if condition="{pagination.hasMorePages}">
                <li class="page-item disabled"><span class="page-link">…</span></li>
            </f:if>
            <f:if condition="{pagination.nextPageNumber} && {pagination.nextPageNumber} <= {pagination.lastPageNumber}">
                <li class="page-item next">
                    <a class="page-link" href="{f:uri.action(action:actionName, arguments:{currentPage: pagination.nextPageNumber})}" title="{f:translate(key:'pagination.next')}">
                        {f:translate(key:'widget.pagination.next', extensionName: 'fluid')}
                    </a>
                </li>
            </f:if>
        </ul>
    </nav>
    </html>
    ```
1.  Clear Cache

    Needed to reload the fluid templates.
