olek07
olek07

Reputation: 563

TYPO3 7.6.18. Pagination widget. Always page 1 displayed

I have a question about the pagination widget. Why do I get always the page 1 displayed? If I call the page 2, the link looks like this: ?tx_gbpartner_partnerlisting[%40widget_0][currentPage]=2&cHash=711721c87d5bb5b17eb8da3fd66b1102 In the pagination index.html I do {pagination} and get:

   pages => array(3 items)
   current => 1 (integer)
   numberOfPages => 3 (double)
   displayRangeStart => 1 (integer)
   displayRangeEnd => 3 (integer)
   hasLessPages => FALSE
   hasMorePages => FALSE
   nextPage => 2 (integer)

The pagination widget doesn't understand the param currentPage. What could be here wrong?

Upvotes: 1

Views: 1565

Answers (3)

Philipp Wrann
Philipp Wrann

Reputation: 1849

The paging is only applied within the paginate widget, if you debug something in your controller you will always have the same result.

The paginate widget takes the queryresult as parameter, extracts the query object, adds limit/offset params to the sql and retrieves the slice of records.

Thats how it works.

To help you i would need to see your controller action and fluid template.

Upvotes: 0

Ashish Patel
Ashish Patel

Reputation: 1031

It is default view for paginate viewhelper, displayed always 1. We are able to change pagination view you can change default widget template. Add following settings into your ext/YourExtensionName/Configuration/TypoScript/setup.txt

plugin.tx_YourExtensionKey {
    view { 
    widget.TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper.templateRootPath = {$plugin.tx_YourExtensionKey.view.templateRootPath}
    }
    settings{
        pagebrowser {
           itemsPerPage         = 8
           insertAbove          = 0
           insertBelow          = 1
           maximumNumberOfLinks = 10
       }         
    }
}

Another thing is that you have to copy/add widget template file into your templates directory, you can copy this template file from typo3/sysext/fluid/Resources/Private/Templates/ViewHelpers/Widget/Paginate/Index.html and make new directory structure like this:

/Templates/ViewHelpers/Widget/Paginate/Index.html

Index.html is your copied file. now you can customize or add your own design layout in this file.

Upvotes: 1

Alex S.
Alex S.

Reputation: 66

Could you try to disable caching for the page with the plugin on it? I would guess it's a caching issue.

Upvotes: 0

Related Questions