Heinz Schilling
Heinz Schilling

Reputation: 2252

TYPO3 routeEnhancer for custom paginate extension

We did a custom extension for paginating because we have external data source. This results in a url like https://domain.ch/de/ourcontent/?tx_vendordspace_vendordspace[@widget_0][currentPage]=3&cHash=e2126ef5f67e3d7539440487d0eda3c9

Following config does nothing:

routeEnhancers:
  VendorDspace:
    type: Extbase
    extension: VendorDspace
    plugin: VendorDspace
    routes:
      routePath: '/dspace-page/{page}'
        _controller: 'Publication::list'
        _arguments:
          page: '@widget_0/currentPage'
    defaults:
      page: '0'
    aspects:
      page:
        type: StaticRangeMapper
        start: '1'
        end: '100'

Any ideas or tipps?

Upvotes: 0

Views: 145

Answers (2)

Heinz Schilling
Heinz Schilling

Reputation: 2252

I have to add a - routePath: '/' and defaultController: 'Publication::list'. A colleague found the bug. See full config:

routeEnhancers:
  VendorDspace:
    type: Extbase
    extension: VendorDspace
    plugin: VendorDspace
    routes:
      - routePath: '/'
        _controller: 'Publication::list'
      - routePath: '/dspace-page/{page}'
        _controller: 'Publication::list'
        _arguments:
          page: '@widget_0/currentPage'
    defaultController: 'Publication::list'
    defaults:
      page: '0'
    aspects:
      page:
        type: StaticRangeMapper
        start: '1'
        end: '100'

Upvotes: 0

Bernd Wilke πφ
Bernd Wilke πφ

Reputation: 10790

compared to my configurations you have a wrong indention.

try:

    routes:
      routePath: '/dspace-page/{page}'
      _controller: 'Publication::list'
      _arguments:
        page: '@widget_0/currentPage'

as I have multiple routes an intermediate level is necessary for you too:

    routes:
      -
        routePath: '/dspace-page/{page}'
        _controller: 'Publication::list'
        _arguments:
          page: '@widget_0/currentPage'

Upvotes: 1

Related Questions