blog
blog copied to clipboard
Pagination in list view - routes issue
Bug Report
Prerequisites
- [ ] Can you reproduce the problem on TYPO3 v9.5 LTS
- [X] Can you reproduce the problem on TYPO3 v10.4 LTS
- [ ] Can you reproduce the problem on TYPO3 v11.x
- [ ] Did you perform a cursory search to see if your bug or feature is already reported?
The pagination in list view doesn't render speaking urls for previous link and for page 1 link on page 2+.
[Description of the bug]
See: https://www.wiesbaden-schelmengraben.de/blog (at the bottom of the page)
Versions
TYPO3 v10.4.10 EXT: blog v10.0.0
The same here: https://www.erfurt-bahai.de/blog.html?tx_blog_posts%5Baction%5D=listRecentPosts&tx_blog_posts%5Bcontroller%5D=Post&cHash=83b243e5a558bb9596674101f87e13f2 TYPO3 v10.4.10, EXT: blog v10.0.0
@derBoogie Looks like you fixed your issue? Very likely by updating pagination/currentPage to currentPage in your route enhancer argument.
@helmut-winkelbach Same goes for you, your blog pagination seems to work?
@mbrodala sure, here is how it works:
routeEnhancers:
BlogPosts:
type: Extbase
extension: Blog
plugin: Posts
routes:
-
routePath: '/page-{page}'
_controller: 'Post::listRecentPosts'
_arguments:
page: '@widget_0/currentPage'
defaultController: 'Post::listRecentPosts'
requirements:
page: \d+
aspects:
page:
type: StaticRangeMapper
start: '1'
end: '99'
That's not the latest version however. The pagination widget was dropped a while ago so you need to use the regular arguments, so page: pagination/currentPage (blog version 10) or page: currentPage (blog version 11) in _arguments.
@mbrodala
I have the same problem in v10.4.23. with page: '@widget_0/currentPage'
If I drop the widget as you mentioned and use page: 'pagination/currentPage' instead, the routing behaviour is reversed: The link to 'Page 2', 'Page-3' and so on respectively 'Next' now has dynamic parameters and 'Page1' (and 'Back' if I am on the second page) shows the correct speaking url.
EDITED
TYPO3 v10.4.10 seems to be working with page: '@widget_0/currentPage' for @derBoogie, but later versions have the problem he described.
I have v10.4.28 and the problem remains: '@widget_0/currentPage' causes the problem no speaking urls for page 1 link on page 2+, page: 'pagination/currentPage' and page: 'currentPage causes the problem @m10a described. (the same backwards so to speak)
@m10a, @derBoogie @firmenpunkt
You only need: page: 'currentPage' without @widget_0/ BlogPosts: type: Extbase extension: Blog plugin: Posts routes: - routePath: '/page-{page}' _controller: 'Post::listRecentPosts' _arguments: page: 'currentPage' defaultController: 'Post::listRecentPosts' requirements: page: \d+ aspects: page: type: StaticRangeMapper start: '1' end: '99'
@helmut-winkelbach @mbrodala page: 'pagination/currentPage' / page: 'currentPage' / page: '@widget_0/currentPage' seem to work only partially since a certain version between T3 v10.4.10 and v10.4.19, none of them does the speaking url routing to 100% with higher 10.4 versions. One of the updates between the 2 versions must have changed the routing behaviour. I tried v10.4.28, v10.4.19 and @m10a tried v10.4.23.
I also tried different blog versions.
@derBoogie did you get any solution?
I used typo3 v10.4.11 and blog extension v11.0.2. When i enable routing then genrate correct link. but when i goto page-2 or other then it's show always first page record.
Please help me. if any one have solution for this.
Defult link: tx_blog_posts%5Bcontroller%5D=Post&tx_blog_posts%5BcurrentPage%5D=2&cHash=9156eca4f20e069f218e52bdf2a629d7
i used below routing configuration.
BlogPosts:
type: Extbase
extension: Blog
plugin: Posts
routes:
-
routePath: '/page-{page}'
_controller: 'Post::listRecentPosts'
_arguments:
page: 'currentPage'
defaultController: 'Post::listRecentPosts'
requirements:
page: '\d+'
aspects:
page:
type: StaticRangeMapper
start: '1'
end: '99'
@Pravin0711, I have updated to 11.5 and there are no problems with the configuration you mentioned.
@Pravin0711, I have updated to 11.5 and there are no problems with the configuration you mentioned.
Is there any solution for v10.4? Customer is not ready for upgrade 10 to 11.
@Pravin0711, I have updated to 11.5 and there are no problems with the configuration you mentioned.
Is there any solution for v10.4? Customer is not ready for upgrade 10 to 11.
I think I found the culprit in my case. It was the old pagination template. Just use the partial <f:render partial="Pagination/Pagination" arguments="{pagination: pagination}" /> and lose the part with " <f:widget.paginate objects="{posts}" as="paginatedPosts"" in /Resources/Private/List.html as it is deprecated.