2

简介:在 TYPO3 v9 中,您可以在不使用 RealURL 扩展的情况下设置开箱即用的语音 URL。此功能在所谓的站点配置中使用 YAML 进行配置

以下配置摘录扩展了流行新闻扩展的讲话 URL。在配置下方category_nametag_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'
4

1 回答 1

0

这很容易。您可以按照ext 中的方式进行操作:新闻

我对类别和标签做了同样的事情,一切都很好。

在此处输入图像描述

看附件: 更多信息在这里

于 2018-11-09T21:13:42.463 回答