如何在 Typo3 9.5.0 上获取 News 7.0.7 的语音 URL
How to get Speaking URLs for News 7.0.7 on Typo3 9.5.0
我真的很喜欢 Typo3 9.5.0 创造的 URL 的轻松。
我唯一的问题是让它与新闻等扩展一起工作。
找不到让它工作的方法,也不知道从哪里开始。感谢您的帮助。
此致
旦
TYPO3 9.5.0
新闻 7.0.7
自版本 7.0.6 起,扩展新闻已准备好使用核心 URL。请确保您的配置正确,例如在站点模块中设置站点。
您可以使用站点配置 YAML 文件中的 routeEnhancers
指令(通常为 htdocs/config/sites//config.yaml)执行此操作。官方文档中有一个例子,虽然隐藏了一点:
这是我正在积极使用的配置:
rootPageId: <site id>
...
routeEnhancers:
NewsPlugin:
type: Extbase
limitToPages:
- 49 (when your news detail page id is 49)
- ...
extension: News
plugin: Pi1
routes:
-
routePath: '/blog/{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: '/archive/{year}/{month}'
_controller: 'News::archive'
defaultController: 'News::list'
defaults:
page: '0'
aspects:
news_title:
type: PersistedAliasMapper
tableName: tx_news_domain_model_news
routeFieldName: path_segment
工作示例 typo3 9.5.5 with tx_news 7.1.0 with PersistedPatternMapper:
routeEnhancers:
NewsPlugin:
type: Extbase
limitToPages: [20,23,29,30]
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'
requirements:
page: '\d+'
aspects:
news_title:
type: PersistedPatternMapper
tableName: 'tx_news_domain_model_news'
routeFieldPattern: '^(?P<path_segment>.+)-(?P<uid>\d+)$'
routeFieldResult: '{path_segment}-{uid}'
page:
type: StaticRangeMapper
start: '1'
end: '200'
我真的很喜欢 Typo3 9.5.0 创造的 URL 的轻松。
我唯一的问题是让它与新闻等扩展一起工作。 找不到让它工作的方法,也不知道从哪里开始。感谢您的帮助。
此致 旦
TYPO3 9.5.0 新闻 7.0.7
自版本 7.0.6 起,扩展新闻已准备好使用核心 URL。请确保您的配置正确,例如在站点模块中设置站点。
您可以使用站点配置 YAML 文件中的 routeEnhancers
指令(通常为 htdocs/config/sites//config.yaml)执行此操作。官方文档中有一个例子,虽然隐藏了一点:
这是我正在积极使用的配置:
rootPageId: <site id>
...
routeEnhancers:
NewsPlugin:
type: Extbase
limitToPages:
- 49 (when your news detail page id is 49)
- ...
extension: News
plugin: Pi1
routes:
-
routePath: '/blog/{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: '/archive/{year}/{month}'
_controller: 'News::archive'
defaultController: 'News::list'
defaults:
page: '0'
aspects:
news_title:
type: PersistedAliasMapper
tableName: tx_news_domain_model_news
routeFieldName: path_segment
工作示例 typo3 9.5.5 with tx_news 7.1.0 with PersistedPatternMapper:
routeEnhancers:
NewsPlugin:
type: Extbase
limitToPages: [20,23,29,30]
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'
requirements:
page: '\d+'
aspects:
news_title:
type: PersistedPatternMapper
tableName: 'tx_news_domain_model_news'
routeFieldPattern: '^(?P<path_segment>.+)-(?P<uid>\d+)$'
routeFieldResult: '{path_segment}-{uid}'
page:
type: StaticRangeMapper
start: '1'
end: '200'