TYPO3 Route Enhancers:将 'routeFieldName' 转换为小写?

TYPO3 Route Enhancers: converting 'routeFieldName' to lowercase?

简介:在 TYPO3 v9 中,您可以在不使用 RealURL 扩展的情况下设置语音 URL out-of-the-box。此功能在 so-called 站点配置 .

中使用 YAML 配置

以下配置摘录扩展了流行新闻扩展的语音 URL。下面配置 category_nametag_name 我 select 相应数据库表中的标题字段。

问:是否可以将这些标题转换为小写字母? 当前配置生成的 URL 类似于 domain.com/category/TYPO3.

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'

很简单。您可以按照 ext: news

中的说明进行操作

我对类别和标签做了同样的操作,一切正常。

看附件: More about it here