更新RTE组件以在AEM中使用块引号

更新RTE组件以在AEM中使用块引号,aem,rte,Aem,Rte,我目前正在AEM 6.2项目中使用RTE富文本编辑器。我想将RTE配置为使用blockquote标记。如何才能做到这一点 <blockquote> 组件代码: <paraformat jcr:primaryType="nt:unstructured" features="*"> <formats jcr:primaryType="cq:WidgetCollection"> <p jcr:primaryType="nt:unst

我目前正在AEM 6.2项目中使用RTE富文本编辑器。我想将RTE配置为使用blockquote标记。如何才能做到这一点

<blockquote>
组件代码:

<paraformat jcr:primaryType="nt:unstructured" features="*">
    <formats jcr:primaryType="cq:WidgetCollection">
        <p  jcr:primaryType="nt:unstructured" description="Paragraph" tag="p"/>
        <h1 jcr:primaryType="nt:unstructured" description="Heading 1" tag="h1"/>
        <h2 jcr:primaryType="nt:unstructured" description="Heading 2" tag="h2"/>
        <h3 jcr:primaryType="nt:unstructured" description="Heading 3" tag="h3"/>
        <h4 jcr:primaryType="nt:unstructured" description="Heading 4" tag="h4"/>
        <h5 jcr:primaryType="nt:unstructured" description="Heading 5" tag="h5"/>
        <blockquote jcr:primaryType="nt:unstructured" description="Block Quote" tag="blockquote"/>
    </formats>
</paraformat> 
参考:


谢谢。

您可以按照官方文档中的说明添加新的块元素:

基本上,您可以通过引入新元素覆盖RTE并扩展paraformat插件。总结步骤包括:

覆盖你的RTE 在RTE控制下创建cq:EditConfig/inplaceEditing/paraformat/format节点。 为您的样式创建一个节点,将其命名为blockquote,并为其提供以下属性->说明:Block Quote&标记:blockquote 确保添加所有其他默认格式,如p、H1、H2等。 就这样。您应该可以在段落样式下拉列表中看到新的段落样式

这是一个总结,因为所有的图片都会使这篇文章过长,但详细的文章可以在以下网址找到:


或者,您需要通过检查/libs/cq/xssprotection/config.xml文件来检查是否允许使用blockquote元素。该文件是自解释的,有很多注释,但一般来说,您应该在下面进行检查,以确保您的标记受支持。OOTB AEM 6.2允许blockquote元素,但某些升级可能会丢失它。

配置是什么意思?您希望RTE将blockquote显示为一个选项,还是希望它允许渲染blockquote?这是两个不同的问题,因此我提出了问题。我的意思是允许RTE使用blockquote。请参阅下面我的答案。我已经讨论了这两个问题。如果您需要更多详细信息,请告诉我!!成功了!!非常感谢。关于config.xml的最后一步很高兴知道。很高兴它成功了。在你更新了可能出错的地方之后,我一直在挠头!如果你愿意,接受答案。这可能会帮助其他人。config.xml是一个难题,尤其是对于升级后遗留的配置。