1

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
        }
    }
}

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

4

3 回答 3

2

您应该将所需的标签添加到配置中

## 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
        }
    }
}
于 2011-11-11T11:21:17.287 回答
1

@HerrSerker 的答案几乎是正确的 - 它向 RTE 添加了对额外标签(表单、按钮、输入)的支持,但您还需要在您的 FE 中允许它们,所以最终结果应该是这样的:

页码

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)
于 2013-02-21T10:17:28.740 回答
0

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

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

于 2011-11-10T22:57:58.350 回答