与Extbase和Yoast一起使用时的Route Enhancer配置

问题描述

由于我已经为我们的typo3扩展之一的单视图条目创建了路由增强器,因此标题和描述字段不再被处理到前端。 <title></title>仅由页面标题而不是记录标题组成,并且<meta name="description" .../>完全丢失。如果我删除路由增强器 SeminarSingleView ,则链接会再次变得丑陋,但标记会正确填充。

Typo3 9.5.14

酵母6.0.1

这是config.yaml中涉及路由增强的部分:

routeEnhancers:
  PageTypeSuffix:
    type: PageType
    default : ''
    map:
      sitemap.xml: 1533906435
      yoast-snippetpreview.json: 1480321830
  SeminarSingleView:
    type: Extbase
    limitToPages: [62,142]
    namespace: the_namespace
    routes:
      - { routePath: '/{url_slug}',_controller: 'Product::show',_arguments: {'url_slug' : 'product'}  }
    defaultController: 'Product::show'
    aspects:
      url_slug:
        type: PersistedAliasMapper
        tableName: 'the_table'
        routeFieldName: 'speaking_url'

路由增强器本身就像一个魅力。有什么我看不到的遗漏吗?我已经阅读了以下两个内容:

https://wiki.sebkln.de/doku.php?id=typo3:yoast_seo

https://docs.typo3.org/p/yoast-seo-for-typo3/yoast_seo/6.0/en-us/Index.html

但是找不到令我震惊的信息。有任何想法吗?如果需要,我可以并且显然会提供更多信息。 yoast-snippetpreview.json: 1480321830行是新的,是我的一部分 尝试解决问题。但它仅将预览固定在后端。没人意识到的问题。

解决方法

我们终于能够解决此问题。

罪魁祸首是扩展程序setup.ts中不推荐使用的Typoscript,因此问题确实取决于从8.7.x到9.5.x的更新。

[globalVar = GP:tx_extension_tablename|field > 0]

必须替换为

[request.getQueryParams()['tx_extension_tablename']['field'] > 0]

更改本身记录在这里:https://www.nitsan.in/blog/all-you-need-to-know-about-typoscript-conditions-with-symfony-expression-language/#c2419

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...