【问题标题】:TYPO3: Allow HTML for Rich Text EditorTYPO3:允许富文本编辑器使用 HTML
【发布时间】:2011-12-25 12:05:37
【问题描述】:

RTE 的默认设置只允许某些类型的 HTML 元素。我也想允许

  • form
  • button
  • input

我该怎么做?我搜索了一下,发现了这个:

## RTE configuration
RTE.default {
    proc {
        # tags allowed
        allowTags = table, tbody, tr, th, td, h1, h2, h3, h4, h5, h6, div, p, br, span, ul, ol, li, re, blockquote, strong, em, b, i, u, sub, sup, strike, a, img, nobr, hr, tt, q, cite, abbr, acronym, center

        # html parser configuration
        HTMLparser_rte {

            # tags allowed
            allowTags < RTE.default.proc.allowTags
        }
    }
}

但我不确定这是否是正确的解决方案...

【问题讨论】:

  • 这个我试过了,没用...

标签: html typo3 rte rich-text-editor


【解决方案1】:

你应该在配置中添加你想要的标签

## RTE configuration
RTE.default {
    proc {
        # tags allowed
        allowTags = table, tbody, tr, th, td, h1, h2, h3, h4, h5, h6, div, p, br, span, ul, ol, li, re, blockquote, strong, em, b, i, u, sub, sup, strike, a, img, nobr, hr, tt, q, cite, abbr, acronym, center

        allowTags := addToList(form, button, input) 

        # html parser configuration
        HTMLparser_rte {

            # tags allowed
            allowTags < RTE.default.proc.allowTags
        }
    }
}

【讨论】:

    【解决方案2】:

    @HerrSerker 的答案几乎是正确的 - 它向 RTE 添加了对额外标签(form、button、input)的支持,但您还需要在您的 FE 中允许它们,因此最终结果应该是这样的:

    页面 TS

    RTE.default.proc.allowTags := addToList(form, button, input)
    RTE.default.proc.entryHTMLparser_db.allowTags < RTE.default.proc.allowTags
    RTE.default.proc.allowTagsOutside := addToList(form)
    

    allowTagsOutside 指示 RTE 允许此标签在 p-tags 之外。

    TS 模板中的 TS 常量

    styles.content.links.allowTags := addToList(form, button, input)
    

    【讨论】:

      【解决方案3】:

      是的。 Alos 您应该取消设置 denyTags 并检查 entryHTMLparser_db 子值

      可以在here 找到默认 RTE 配置的示例。

      【讨论】:

      • 如果我使用denyTags &gt; 所有的denyTags 会被覆盖吗?我想保留标准设置,但只允许表单、按钮、输入。
      • @testing 与 addToList 相反的是 removeFromList。您可以将其与 denyTags 一起使用
      • @testing 你可以重新定义denyTags,用它编辑的默认值
      猜你喜欢
      • 1970-01-01
      • 2015-01-11
      • 1970-01-01
      • 2014-08-18
      • 1970-01-01
      • 1970-01-01
      • 2020-06-26
      • 1970-01-01
      • 2011-06-18
      相关资源
      最近更新 更多