1

I am using the following config.yaml for the standard news plugin:

NewsPlugin:
  type: Extbase
  limitToPages:
    - 3
    - 15
  extension: News
  plugin: Pi1
  routes:
    -
      routePath: '/l/{page}'
      _controller: 'News::list'
      _arguments:
        page: '@widget_0/currentPage'
    -
      routePath: '/tag/{tag_name}'
      _controller: 'News::list'
      _arguments:
        tag_name: overwriteDemand/tags
    -
      routePath: '/{news_title}'
      _controller: 'News::detail'
      _arguments:
        news_title: news
    -
      routePath: '/archiv/{year}/{month}'
      _controller: 'News::archive'
  defaultController: 'News::list'
  defaults:
    page: '0'
    news_title: ''
    tag_name: ''
    year: '2019'
    month: '01'
  aspects:
    news_title:
      type: PersistedAliasMapper
      tableName: tx_news_domain_model_news
      routeFieldName: path_segment

Now it all works pretty well, the only problem is, when I use the pagination, there is always a cHash attached to my url. Like a link to page 2 results in

http://www.example.com/newspage/l/2?cHash=313213213213213a2f13asf321

Any ideas why this happens?

Peter Kraume
  • 3,577
  • 2
  • 21
  • 39
Chi
  • 1,320
  • 1
  • 14
  • 48

2 Answers2

2

A cHash will be added if the requirements are too loose or if there are no requirements at all. It can also be avoided with a StaticRangeMapper.

I'm also struggling with setting up the routeEnhancers for news. You may have a look at my approach for applying pagination without cHash.

Sybille Peters
  • 2,832
  • 1
  • 27
  • 49
Ben
  • 811
  • 12
  • 28
1

Thanks to ben I found a solution that worked:

NewsPlugin:
  type: Extbase
  extension: News
  plugin: Pi1
  routes:
    -
      routePath: '/l/{page}'
      _controller: 'News::list'
      _arguments:
        page: '@widget_0/currentPage'
    -
      routePath: '/tag/{tag_name}'
      _controller: 'News::list'
      _arguments:
        tag_name: overwriteDemand/tags
    -
      routePath: '/{news_title}'
      _controller: 'News::detail'
      _arguments:
        news_title: news
    -
      routePath: '/archiv/{year}/{month}'
      _controller: 'News::archive'
  defaultController: 'News::list'
  defaults:
    page: '0'
    news_title: ''
    tag_name: ''
    year: '2019'
    month: '01'
  aspects:
    news_title:
      type: PersistedAliasMapper
      tableName: tx_news_domain_model_news
      routeFieldName: path_segment
    '@widget_0/currentPage':
      type: StaticRangeMapper
      start: '1'
      end: '1000'
Chi
  • 1,320
  • 1
  • 14
  • 48
  • I've just tried your new solution: the paginator link from /l/2 (page 2) to the first page has lots of get parameters like ?tx_news_pi1%5Baction%5D=list&tx_news_pi1%5Bcontroller%5D=News&cHash=123456789. Does it work in your environment? – Ben Feb 04 '19 at 17:24