TYPO3 routing does not work with pagination (or I don't know how)
TYPO3 10, Extension version 2.2.0
I tried the following configuration
Album:
type: Extbase
extension: FsMediaGallery
plugin: Mediagallery
namespace: tx_fsmediagallery_mediagallery
routes:
- routePath: '/album/{collection_title}/{page}'
_controller: 'MediaAlbum::showAlbum'
_arguments:
collection_title: 'mediaAlbum'
page: '@widget_assets/currentPage'
defaults:
page: '1'
defaultController: 'MediaAlbum::showAlbum'
aspects:
collection_title:
type: PersistedAliasMapper
tableName: sys_file_collection
routeFieldName: slug
page:
type: StaticRangeMapper
start: '1'
end: '1000'
The album view works with a nice URL, but the pagination links are with GET parameters (and missing any album information), e.g.
https://myhost/pictures?tx_fsmediagallery_mediagallery%5B%40widget_assets%5D%5BcurrentPage%5D=2&cHash=8bdd7dd6611f0e663f259f7b000c109b
I get nice URLs for the album link, e.g.:
https://myhost/pictures/my-album-title/
this works, but not with pagination.
If I open the album page with a complete URL with only GET parameters (routing configuration disabled), then enable the routing configuration, clear the cache and reload the page, I get nice pagination links like
https://myhost/pictures/my-album-title/2
but this always leads to a 404 error.
Please give me a working example for that requirement, thanks!
Comments (4)
-
repo owner -
repo owner - changed status to open
-
repo owner @Wolfgang Klinger the url you give as example doesn’t match you
route
configuration.instead of
https://myhost/pictures/my-album-title/2
it should behttps://myhost/pictures/album/my-album-title/2
the sectionalbum
is missing. Maybe you can try the update example just validated this again and that should work. See https://bitbucket.org/franssaris/fs_media_gallery/src/2.x/Configuration/Routes/Example.yaml -
repo owner - changed version to 2.x
- Log in to comment
@Wolfgang Klinger maybe its related to the issue described in
#64. Update to latest 2.x version and make sure all the<f:widget.link
tags in your template holdaddQueryStringMethod="GET"