ext:news 列表视图插件位于 www.domain.com/news [ID 9] 页面上,详细视图位于 www.domain.com/article [ID 39] 上。
我尝试了功能描述的“Extbase插件增强器”示例,但这引起了一些问题:
造成某些问题的原因之一可能是分页器未在其链接中指定控制器:news?tx_news_pi1[@widget_0][currentPage]=2&cHash=123456789
我将其拆分为两个单独的路由增强器(Extbase + 插件),删除了“defaultController”、“defaults”、“requirements”段并添加了“aspects”:
routeEnhancers:
NewsDetail:
type: Extbase
limitToPages: [39]
extension: News
plugin: Pi1
routes:
- { routePath: '/{news_title}', _controller: 'News::detail', _arguments: {'news_title': 'news'} }
aspects:
news_title:
type: PersistedAliasMapper
tableName: 'tx_news_domain_model_news'
routeFieldName: 'path_segment'
NewsList:
type: Plugin
limitToPages: [9]
routePath: '/{@widget_0/currentPage}'
namespace: 'tx_news_pi1'
aspects:
'@widget_0/currentPage':
type: …Run Code Online (Sandbox Code Playgroud)