简体   繁体   English

TYPO3 v9.5 URL Segment [slug] 记录的生成不应在页面 slug 之前

[英]TYPO3 v9.5 URL Segment [slug] generation for a record shall not prepend the page slug

Is there any possibility to modify the automatic slug generation for a record in the TYPO3 backend list module in a way that the page slug of the sysfolder is not prepended?是否有可能以不预先添加 sysfolder 的页面 slug 的方式修改 TYPO3 后端列表模块中记录的自动 slug 生成?

The extension configuration adds the slug field in a way that the slug for the record should be generated by the fields title and itemnumber.扩展配置以一种方式添加 slug 字段,即记录的 slug 应由字段 title 和 itemnumber 生成。 This works fine on one TYPO3 9.5 website, but it does not work on the other.这在一个 TYPO3 9.5 网站上运行良好,但在另一个网站上不起作用。 The extension file is here:扩展文件在这里:

https://github.com/franzholz/tt_products/blob/master/Configuration/TCA/tt_products.php https://github.com/franzholz/tt_products/blob/master/Configuration/TCA/tt_products.php

The current sysfolder page has this slug:当前的 sysfolder 页面有这个 slug:

URL Segment: abc

The current record has these data:当前记录具有以下数据:

Title name: product 1
itemnumber: item1

The automatically generated slug will be:自动生成的 slug 将是:

abcproduct-1-item1

The wanted resulting slug is:想要的结果是:

product-1-item1

Where is the configuration to change the behaviour that the sysfolder page slug is not prepended any more during the slug's auto generation?更改 sysfolder页面 slug在 slug 自动生成期间不再预先添加的行为的配置在哪里?

I have found the solution.我找到了解决办法。

The TCA of the table must be changed in this way: prefixParentPageSlug=false表的TCA必须这样改: prefixParentPageSlug=false

'generatorOptions' => array (
    'fields' => array ('title', 'itemnumber'),
    'fieldSeparator' => '-',
    'prefixParentPageSlug' => false,
    'replacements' => array (
        '/' => '',
    ),
),

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM