TYPO3 更改 slug 前缀

发布于 2025-01-19 07:28:02 字数 864 浏览 5 评论 0原文

是否可以更改Slug场的前缀?有url https://www.example.com/myslug 。但应该是 https://www.example.com/page.com/page1/page1/page2/page2/myslug
我对此进行了扩展:

'appearance' => [
  'prefix' => \VENDOR\EXT\UserFunctions\FormEngine\SlugPrefix::class . '->getPrefix'
],

看起来像这样:

use TYPO3\CMS\Backend\Form\FormDataProvider\TcaSlug;

    class SlugPrefix
    {
        public function getPrefix(array $parameters, TcaSlug $reference): string
        {
            return '';
        }
    }

所以现在前缀为空了。如何设置URL的前缀?我在Typoscript设置中具有URL的ID。

Is it possible to change the prefix of the slug field? There is the url https://www.example.com/MYSLUG. But it should be https://www.example.com/page1/page2/MYSLUG.
I've extended the TCA with this:

'appearance' => [
  'prefix' => \VENDOR\EXT\UserFunctions\FormEngine\SlugPrefix::class . '->getPrefix'
],

and it looks like this:

use TYPO3\CMS\Backend\Form\FormDataProvider\TcaSlug;

    class SlugPrefix
    {
        public function getPrefix(array $parameters, TcaSlug $reference): string
        {
            return '';
        }
    }

So now the prefix is empty. How can I set the prefix to an URL? I have the ID of the URL in the typoscript setup.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文