[TYPO3-mvc] paginate via ajax
Federico Bernardin
typo3list at bernardin.it
Wed Aug 7 09:31:51 CEST 2013
Thanks Domi,
infact I have just implemented a similar solution, but you must change some others parts of widget view helper:
the controller injected is fluid widget paginate controller instead I need my own controller, so I have to overwrite inject function and set the @inject into property.
More other small feature to implement for generic functionality.
Cheers
federico
Il giorno 07/ago/2013, alle ore 03:59, Domi <djgarms at gmail.com> ha scritto:
> 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
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
More information about the TYPO3-project-typo3v4mvc
mailing list