[TYPO3-mvc] paginate via ajax

Domi djgarms at gmail.com
Wed Aug 7 03:59:03 CEST 2013


Hi Federico,

you have to do write your own paginate viewhelper by doing following steps:

1: Copy fluid PaginateViewHelper.php into your own extension into the 
Classes/ViewHelpers/Widget/PaginateViewHelper.php

2: Copy fluid PaginateController.php into your own extension into the 
Classes/ViewHelpers/Widget/Controller/PaginateController.php

3: Copy fluid Index.html of paginate into your template folder as 
Resources/Private/Templates/ViewHelpers/Widget/Paginate/Index.html

Now adjust your files as following:

1: PaginateViewHelper.php
Refer the injected PaginateController to your own Controller

2: PaginateController.php
inside of the indexAction paste this to the very beginning of the function:
(...)
// be aware of currentPage of ajax call
if (GeneralUtility::_GP('currentPage')) {
   $this->currentPage = (integer)GeneralUtility::_GP('currentPage');
} else {
   $this->currentPage = (integer)$currentPage;
}
(...)

3: Index.html
All
<widget.link (...)>(...)</link>
needs to be updated to:
<widget.link ajax="TRUE" (...)>(...)</link>


This are the steps that you paginate view helper creates the correct 
ajax link. Be aware that you have to include fluid ajax typoscript into 
your typoscript (typeNum 7076)

Now you need to write the javascript file to handle the request 
accordingly and replace the content with the requested ajax content.

Its far to complicated if you ask me and it took long time for me 
figuring out a working solution. Hope that the paginate view helper will 
get the ajax="" option inside of the ViewHelper arguments that the first 
steps getting simplified.

Hope this helps you for the beginning, lot of coding is still necessary 
though...

Cheers,
Dominic


More information about the TYPO3-project-typo3v4mvc mailing list