【发布时间】:2020-07-23 12:41:06
【问题描述】:
我在 TYPO3 9.5 中遇到路由和 tx_news 问题。官方的例子我都试过了,问题依旧,不知道是什么原因。
我喜欢有这样的 URL:
...home/news/detail/project-lounge-movetia-2
但我明白了:
...home/news/detail/project-lounge-movetia-2?tx_news_pi1[day]=11&tx_news_pi1[month]=12&tx_news_pi1[year]=2019&cHash=8fd7057d32ae3e3810b76f0bf4a06e39
配置是标准的:
routeEnhancers:
News:
type: Extbase
limitToPages:
- 40
- 54
- 55
extension: News
plugin: Pi1
routes:
- routePath: '/'
_controller: 'News::list'
- routePath: '/page-{page}'
_controller: 'News::list'
_arguments:
page: '@widget_0/currentPage'
- routePath: '/{news-title}'
_controller: 'News::detail'
_arguments:
news-title: news
- routePath: '/{category-name}'
_controller: 'News::list'
_arguments:
category-name: overwriteDemand/categories
- routePath: '/{tag-name}'
_controller: 'News::list'
_arguments:
tag-name: overwriteDemand/tags
defaultController: 'News::list'
defaults:
page: '40'
aspects:
news-title:
type: PersistedAliasMapper
tableName: tx_news_domain_model_news
routeFieldName: path_segment
page:
type: StaticRangeMapper
start: '1'
end: '100'
category-name:
type: PersistedAliasMapper
tableName: sys_category
routeFieldName: slug
tag-name:
type: PersistedAliasMapper
tableName: tx_news_domain_model_tag
routeFieldName: slug
requirements:
page: '\d+'
新闻标题得到正确“增强”,但其余部分仍然存在(哈希、id 等)我不知道为什么会发生这种情况。我读了很多次关于路由的手册,但我不明白。 :(
【问题讨论】:
标签: url routes typo3-9.x tx-news