Feature #79430

Make pagination possible without Extbase environment

Added by Thomas Löffler over 2 years ago. Updated 2 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Fluid
Start date:
2017-01-23
Due date:
% Done:

0%

PHP Version:
Tags:
fluid, paginate
Complexity:
Sprint Focus:

Description

Problem:
I am using the DataProcessor to get records from the database and I want to paginate them.
As there is an array it works for the first page, but all other pages don't work due to the wrong parameter given for the page number.

In Extbase extensions there is the parameter tx_myplugin_mycontroller[@widget][currentPage]
When using the array from the DataProcessor I get tx__[@widget][currentPage]

Solution:
It would be cool to set the parameter manually by configuration in the f:widget.paginate ViewHelper, so I can use it for non-Extbase environments as well.

just_news_0.0.7.zip (29.1 KB) Thomas Löffler, 2017-01-28 19:26


Related issues

Related to TYPO3 Core - Bug #79922: fluid widget paginate - pagination links take no action New 2017-02-20
Related to TYPO3 Core - Feature #79403: Add library of universal, general-purpose ViewHelpers into f: namespace Closed 2017-01-21

History

#1 Updated by Thomas Löffler over 2 years ago

  • Subject changed from Make pagination possible without Extbase stuff to Make pagination possible without Extbase environment

#2 Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51376

#3 Updated by Thomas Löffler over 2 years ago

I've attached my extension with a pagebrowser.

1) Install the extension
2) Include static template
3) Create a sysfolder and as subpages multiple news pages
4) Create a news_list content element
5) The pagebrowser actually shows maximum 3 items

Imho the patch of https://review.typo3.org/51376 does not contain any changes which touches this issue.

#4 Updated by Riccardo De Contardi over 2 years ago

  • Target version changed from 8 LTS to 9.0

#5 Updated by Claus Due over 2 years ago

Imho the patch of https://review.typo3.org/51376 does not contain any changes which touches this issue.

It does that by providing iterator viewhelpers capable of returning the slice/next/prev/current/max etc. values that you need when you're creating links that contain for example a page number and number of items per page. With those two values the rest can be calculated with the ViewHelpers that would be added by the patch in question.

#6 Updated by Sebastian Helzle over 2 years ago

We had the same problem with 8.7 LTS and dataprocessors.

I found a way around it by passing values to the extbase subproperties of the FluidTemplate object.

extbase {
        pluginName = Demo
        controllerName = Demo
        controllerExtensionName = website
        controllerActionName = show
}

Then it works perfectly fine. Also adding a rule for realurl based on those values works without a problem.
So apparently there is no need for an actual Environment there.

If we find any issues with this solution in our project I will post it.

#7 Updated by Susanne Moog over 1 year ago

  • Target version changed from 9.0 to 9.2

#8 Updated by Riccardo De Contardi over 1 year ago

  • Related to Bug #79922: fluid widget paginate - pagination links take no action added

#9 Updated by Susanne Moog over 1 year ago

  • Target version changed from 9.2 to Candidate for Major Version

#10 Updated by Klaus Weidenbach over 1 year ago

Tried to add pagination to a default File Lists content element in TYPO3 9.1 which uses a FilesProcessor. I have customised the Uploads.html template from fluid_styled_content to include f:widget.paginate and the first paginated page is displayed correctly, but all other paginated pages do not work. I realised the same behaviour as described in this issue.
The workaround from comment 6 does help, but is not so obvious I think.

#11 Updated by Robert Wildling over 1 year ago

Sebastian Helzle wrote:

We had the same problem with 8.7 LTS and dataprocessors.

I found a way around it by passing values to the extbase subproperties of the FluidTemplate object.

extbase {
pluginName = Demo
controllerName = Demo
controllerExtensionName = website
controllerActionName = show
}

Sebastian: could you share a bit more code for those, who are not so experienced? Where exactly do you add that code? What if my extension has 10 plugins or so? What to do then?
Thank you!

#12 Updated by Christian Kuhn about 1 year ago

  • Status changed from Under Review to New

#13 Updated by Christian Kuhn about 1 year ago

  • Related to Feature #79403: Add library of universal, general-purpose ViewHelpers into f: namespace added

#14 Updated by Wolfgang Wagner 2 months ago

Still the same problem in 9.5.9

Also available in: Atom PDF