【发布时间】:2019-04-18 09:48:07
【问题描述】:
我使用 TYPO3 V9.5.5 和 PHP V7.2.10。还安装了 tx-news 插件。站点配置已设置并可以正常工作。但是,如果我为新闻详细信息添加 routeEnhancers,它不会在 url 中显示。它总是看起来像:http://p510984.mittwaldserver.info/aktuell/detail?tx_news_pi1%5Bnews%5D=5&cHash=c68f25c1ef4b5bd7320220373cfed332
我在 stackoverflow 和 google 中搜索了解决方案。我还阅读了新闻扩展的手册https://docs.typo3.org/typo3cms/extensions/news/stable/AdministratorManual/BestPractice/Routing/
即使是 TYPO3 和 PHP 缓存刷新也无济于事。
目前我有以下代码:
routeEnhancers:
NewsPlugin:
type: Extbase
limitToPages:
- 17
extension: News
plugin: Pi1
routes:
- { 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
是否需要“defaultController and defaults: page: 0”?
【问题讨论】:
-
在方面,您似乎拼错了“新闻标题”。它应该是“news_title”(与路由 -> 参数中的相同)。
-
@Nitori:谢谢你给我看错字。但不幸的是,这并没有改变任何事情。
-
我可以解决它!在我从 TYPO3 V8.7 获取的 Sitepackage 中,我忘记了我有以下代码:
plugin.tx_news.seetings.link.skipControllerAndAction = 1。在我取消注释后,它就像一个魅力。
标签: typo3 url-routing tx-news typo3-9.x