Good practice on how to set up routeEnhancers for list and detail view of ext:news?

前端 未结 3 1394
生来不讨喜
生来不讨喜 2020-12-20 00:41

Precondition

The ext:news list view plugin is on page www.domain.com/news [ID 9] and the detail view on www.domain.com/article [ID 39].

Following the offi

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-20 01:29

    yes, you can have them both in the same routeEnhancer - without the unwanted segments:

    routeEnhancers:
     NewsPlugin:
      type: Extbase
      limitToPages:
        - 9
        - 39 
      extension: News
      plugin: Pi1
      routes:
        -
         routePath: '/{page}'
         _controller: 'News::list'
         _arguments:
           page: '@widget_0/currentPage'
        -
         routePath: '/{news_title}'
         _controller: 'News::detail'
         _arguments:
           news_title: news
      defaultController: 'News::list'
      defaults:
       page: '0'
      aspects:
       news_title:
        type: PersistedAliasMapper
        tableName: tx_news_domain_model_news
        routeFieldName: path_segment
       page:
        type: StaticRangeMapper
        start: '1'
        end: '999'
    

提交回复
热议问题