Typo3 类型3路由增强子:转换';routeFieldName';改成小写?
简介:在Typo3V9中,您可以在不使用RealURL扩展的情况下直接设置语音URL。在所谓的站点配置中,使用YAML配置此功能 下面的配置摘录扩展了流行新闻扩展的发言URL。在configTypo3 类型3路由增强子:转换';routeFieldName';改成小写?,typo3,typo3-9.x,Typo3,Typo3 9.x,简介:在Typo3V9中,您可以在不使用RealURL扩展的情况下直接设置语音URL。在所谓的站点配置中,使用YAML配置此功能 下面的配置摘录扩展了流行新闻扩展的发言URL。在configcategory\u name和tag\u name下面,我选择相应数据库表中的title字段 Q:是否可以将这些标题转换为小写字母?当前配置会生成类似domain.com/category/TYPO3的URL 这很容易。你可以按照世界上的标准来做 我做了同样的分类和标签,这一切都很好 请看附件: 我希望通
category\u name
和tag\u name
下面,我选择相应数据库表中的title字段
Q:是否可以将这些标题转换为小写字母?当前配置会生成类似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'