CQ rich text field editor enable bold, italic and underline styles, plus bullet and numbered lists only

六月ゝ 毕业季﹏ 提交于 2019-12-11 10:49:22

问题


I have a rich text field editor widget, What I need is to activate functions (bold, italic and underline styles, plus bullet and numbered lists only.)

Here is the xml of my widget:

<richtextfield
     jcr:primaryType="cq:Widget"
     fieldLabel="this is rich text field"
     name="./richtextfield"
     xtype="richtext">
     <rtePlugins jcr:primaryType="nt:unstructured">
           <subsuperscript
           jcr:primaryType="nt:unstructured"
           features="*"/>
     </rtePlugins>
 </richtextfield>

as you can see i have all features enabled here,,,but this is not i need, as i just need bold, italic and underline styles, plus bullet and numbered lists enabled only.

any suggestions? Thanks


回答1:


You need to add nodes for the feature category and enable or disable features of this category. Have a look at the documentation: http://dev.day.com/docs/en/cq/current/administering/configuring_rich_text_editor.html

Here is an example of a rather restricted RTE I am using:

<text
    jcr:primaryType="cq:Widget"
    externalStyleSheets="[/etc/designs/rtg/clientlibs/author/style/source/rte.css]"
    hideLabel="{Boolean}true"
    name="./text"
    xtype="richtext">
    <rtePlugins jcr:primaryType="nt:unstructured">
        <format
            jcr:primaryType="nt:unstructured"
            features="[bold,italic]"/>
        <justify
            jcr:primaryType="nt:unstructured"
            features=""/>
        <lists
            jcr:primaryType="nt:unstructured"
            features="[ordered,unordered]"/>
        <styles
            jcr:primaryType="nt:unstructured"
            features="*">
            <styles jcr:primaryType="cq:WidgetCollection">
                <f125
                    jcr:primaryType="nt:unstructured"
                    cssName="f125"
                    text="Font Size 125% (15px)"/>
                <f150
                    jcr:primaryType="nt:unstructured"
                    cssName="f150"
                    text="Font Size 150% (18px)"/>
            </styles>
        </styles>
    </rtePlugins>
</text>


来源:https://stackoverflow.com/questions/24650723/cq-rich-text-field-editor-enable-bold-italic-and-underline-styles-plus-bullet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!