简介:在 TYPO3 v9 中,您可以在不使用 RealURL 扩展的情况下设置开箱即用的语音 URL。此功能在所谓的站点配置中使用 YAML 进行配置。
以下配置摘录扩展了流行新闻扩展的讲话 URL。在配置下方category_name
,tag_name
我选择相应数据库表中的标题字段。
问:是否可以将这些标题转换为小写字母?当前配置会生成类似domain.com/category/TYPO3的 URL 。
routeEnhancers:
NewsPlugin:
type: Extbase
limitToPages: [17,4]
extension: News
plugin: Pi1
routes:
# Detail view:
- routePath: '/{news_title}'
_controller: 'News::detail'
_arguments: {'news_title': 'news'}
# Categories:
- routePath: '/{category_name}'
_controller: 'News::list'
_arguments: {'category_name': 'overwriteDemand/categories'}
# Tags:
- routePath: '/{tag_name}'
_controller: 'News::list'
_arguments: {'tag_name': 'overwriteDemand/tags'}
defaultController: 'News::list'
aspects:
news_title:
type: PersistedAliasMapper
tableName: 'tx_news_domain_model_news'
routeFieldName: 'path_segment'
category_name:
type: PersistedAliasMapper
tableName: 'sys_category'
routeFieldName: 'title'
tag_name:
type: PersistedAliasMapper
tableName: 'tx_news_domain_model_tag'
routeFieldName: 'title'