You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

TYPO3后台RTE编辑器链接浏览器文件标签消失问题求助

TYPO3 v12迁移后RTE链接浏览器「文件」标签恢复方案

问题背景

项目从TYPO3 v11升级到v12后,RTE(富文本编辑器)的链接浏览器中,用于选择已上传文件(如PDF)的「文件」标签消失,无法直接添加文件链接。

已尝试无效操作:

  • 移除Bootstrap配置,仅使用官方full预设
  • 清空后端所有加载的TsConfig
  • 卸载bootstrap_package及相关主题插件

当前使用的bootstrap_package RTE配置代码:

imports:
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" }

editor:
  externalPlugins:
    bootstrappackage_address:
      resource: "EXT:bootstrap_package/Resources/Public/CKEditor/Plugins/Address/plugin.min.js"
    bootstrappackage_box:
      resource: "EXT:bootstrap_package/Resources/Public/CKEditor/Plugins/Box/plugin.min.js"
    bootstrappackage_columns:
      resource: "EXT:bootstrap_package/Resources/Public/CKEditor/Plugins/Columns/plugin.min.js"
    bootstrappackage_indent:
      resource: "EXT:bootstrap_package/Resources/Public/CKEditor/Plugins/Indent/plugin.min.js"
    bootstrappackage_table:
      resource: "EXT:bootstrap_package/Resources/Public/CKEditor/Plugins/Table/plugin.min.js"

config:
    contentsCss: "EXT:bootstrap_package/Resources/Public/Css/bootstrap5-rte.min.css"

    stylesSet:
        - { name: "Lead", element: "p", attributes: { 'class': 'lead' } }
        - { name: "Small", element: "small" }

        - { name: "Table", element: "table", attributes: { 'class': 'table' } }
        - { name: "Table Striped", element: "table", attributes: { 'class': 'table table-striped' } }
        - { name: "Table Bordered", element: "table", attributes: { 'class': 'table table-bordered' } }
        - { name: "Table Condensed", element: "table", attributes: { 'class': 'table table-condensed' } }

        - { name: "Row Active", element: "tr", attributes: { 'class': 'table-active' } }
        - { name: "Row Success", element: "tr", attributes: { 'class': 'table-success' } }
        - { name: "Row Info", element: "tr", attributes: { 'class': 'table-info' } }
        - { name: "Row Warning", element: "tr", attributes: { 'class': 'table-warning' } }
        - { name: "Row Danger", element: "tr", attributes: { 'class': 'table-danger' } }

        - { name: "Cell Active", element: "td", attributes: { 'class': 'table-active' } }
        - { name: "Cell Success", element: "td", attributes: { 'class': 'table-success' } }
        - { name: "Cell Info", element: "td", attributes: { 'class': 'table-info' } }
        - { name: "Cell Warning", element: "td", attributes: { 'class': 'table-warning' } }
        - { name: "Cell Danger", element: "td", attributes: { 'class': 'table-danger' } }

        - { name: "Button Default", element: "a", attributes: { 'class': 'btn btn-default' } }
        - { name: "Button Primary", element: "a", attributes: { 'class': 'btn btn-primary' } }
        - { name: "Button Secondary", element: "a", attributes: { 'class': 'btn btn-secondary' } }
        - { name: "Button Tertiary", element: "a", attributes: { 'class': 'btn btn-tertiary' } }
        - { name: "Button Quaternary", element: "a", attributes: { 'class': 'btn btn-quaternary' } }
        - { name: "Button Success", element: "a", attributes: { 'class': 'btn btn-success' } }
        - { name: "Button Info", element: "a", attributes: { 'class': 'btn btn-info' } }
        - { name: "Button Warning", element: "a", attributes: { 'class': 'btn btn-warning' } }
        - { name: "Button Danger", element: "a", attributes: { 'class': 'btn btn-danger' } }

        - { name: "Button Outline Default", element: "a", attributes: { 'class': 'btn btn-outline-default' } }
        - { name: "Button Outline Primary", element: "a", attributes: { 'class': 'btn btn-outline-primary' } }
        - { name: "Button Outline Secondary", element: "a", attributes: { 'class': 'btn btn-outline-secondary' } }
        - { name: "Button Outline Tertiary", element: "a", attributes: { 'class': 'btn btn-outline-tertiary' } }
        - { name: "Button Outline Quaternary", element: "a", attributes: { 'class': 'btn btn-outline-quaternary' } }
        - { name: "Button Outline Success", element: "a", attributes: { 'class': 'btn btn-outline-success' } }
        - { name: "Button Outline Info", element: "a", attributes: { 'class': 'btn btn-outline-info' } }
        - { name: "Button Outline Warning", element: "a", attributes: { 'class': 'btn btn-outline-warning' } }
        - { name: "Button Outline Danger", element: "a", attributes: { 'class': 'btn btn-outline-danger' } }

        - { name: "Link Arrow", element: "a", attributes: { 'class': 'link-arrow' } }
        - { name: "Link Chevron", element: "a", attributes: { 'class': 'link-chevron' } }
        - { name: "Link Page", element: "a", attributes: { 'class': 'link-page' } }
        - { name: "Link Folder", element: "a", attributes: { 'class': 'link-folder' } }
        - { name: "Link File", element: "a", attributes: { 'class': 'link-file' } }
        - { name: "Link External", element: "a", attributes: { 'class': 'link-external' } }
        - { name: "Link Mail", element: "a", attributes: { 'class': 'link-mail' } }
        - { name: "Link Globe", element: "a", attributes: { 'class': 'link-globe' } }

        - { name: "List Unstyled", element: "ul", attributes: { 'class': 'list-unstyled' } }
        - { name: "List Inline", element: "ul", attributes: { 'class': 'list-inline' } }
        - { name: "List Check", element: "ul", attributes: { 'class': 'list-check' } }
        - { name: "List Info", element: "ul", attributes: { 'class': 'list-info' } }
        - { name: "List Warning", element: "ul", attributes: { 'class': 'list-warning' } }
        - { name: "List Ban", element: "ul", attributes: { 'class': 'list-ban' } }
        - { name: "List Chevron", element: "ul", attributes: { 'class': 'list-chevron' } }

        - { name: "Lowercased text", element: "span", attributes: { 'class': 'text-lowercase' } }
        - { name: "Uppercased text", element: "span", attributes: { 'class': 'text-uppercase' } }
        - { name: "Capitalized text", element: "span", attributes: { 'class': 'text-capitalize' } }
        - { name: "Muted", element: "span", attributes: { 'class': 'text-muted' } }
        - { name: "Primary", element: "span", attributes: { 'class': 'text-primary' } }
        - { name: "Secondary", element: "span", attributes: { 'class': 'text-secondary' } }
        - { name: "Tertiary", element: "span", attributes: { 'class': 'text-tertiary' } }
        - { name: "Quaternary", element: "span", attributes: { 'class': 'text-quaternary' } }
        - { name: "Success", element: "span", attributes: { 'class': 'text-success' } }
        - { name: "Info", element: "span", attributes: { 'class': 'text-info' } }
        - { name: "Warning", element: "span", attributes: { 'class': 'text-warning' } }
        - { name: "Danger", element: "span", attributes: { 'class': 'text-danger' } }

    toolbarGroups:
        - { name: styles, groups: [ format, styles ] }
        - { name: basicstyles, groups: [ basicstyles ] }
        - { name: paragraph, groups: [ list, indent, blocks, align ] }
        - "/"
        - { name: links, groups: [ links ] }
        - { name: clipboard, groups: [ clipboard, cleanup, undo ] }
        - { name: editing, groups: [ spellchecker ] }
        - { name: insert, groups: [ insert ] }
        - { name: tools, groups: [ table, specialchar ] }
        - { name: document, groups: [ mode ] }

    format_tags: "p;h1;h2;h3;h4;h5;pre"

    justifyClasses:
        - text-left
        - text-center
        - text-right
        - text-justify

    extraPlugins:
        - justify
        - autolink
        - bootstrappackage_address
        - bootstrappackage_box
        - bootstrappackage_columns
        - bootstrappackage_indent
        - bootstrappackage_table

    removePlugins:
        - image

    removeButtons:
        - Anchor
        - Underline
        - Strike

classesAnchor:
    page:
        class: 'link-page'
        type: 'page'
    folder:
        class: 'link-folder'
        type: 'folder'
    file:
        class: 'link-file'
        type: 'file'
    external:
        class: 'link-external'
        type: 'url'
    mail:
        class: 'link-mail'
        type: 'mail'

buttons:
    link:
        properties:
            class:
                allowedClasses: 'link-arrow, link-page, link-folder, link-file, link-external, link-mail'

解决方案

TYPO3 v12对RTE链接浏览器的配置逻辑做了调整,需要显式启用「文件」标签。在现有RTE配置的buttons.link节点下添加linkBrowser配置:

buttons:
  link:
    # 保留原有properties配置
    properties:
        class:
            allowedClasses: 'link-arrow, link-page, link-folder, link-file, link-external, link-mail'
    # 新增链接浏览器配置
    linkBrowser:
      enabled: true
      configuration:
        file:
          enabled: true
        # 可按需启用其他标签,比如页面、外部链接、邮件等
        page:
          enabled: true
        external:
          enabled: true
        mail:
          enabled: true

额外检查项

  1. Page TSConfig权限配置:确保在Page TSConfig中允许文件链接选择:
RTE.default.linkBrowser.file = 1
  1. 用户组权限:检查当前编辑用户所属组是否拥有「文件」模块的访问权限,以及选择文件的权限(在用户组的「模块权限」和「文件权限」中配置)。

  2. 清除缓存:修改配置后,务必清除TYPO3后端所有缓存(包括配置缓存、页面缓存),确保配置生效。

内容的提问来源于stack exchange,提问作者Mohamed Masmoudi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.21 17:39:51