问题描述
我有一个丰富的文本字段编辑器小部件,我需要的是激活函数(粗体,斜体和下划线样式,只有子弹和编号列表。)
这是我的小部件的xml:
< richtextfield
jcr:primaryType =cq: Widget
fieldLabel =这是富文本字段
name =./ richtextfield
xtype =richtext>
< rtePlugins jcr:primaryType =nt:unstructured>
< subsuperscript
jcr:primaryType =nt:unstructured
features =*/>
< / rtePlugins>
< / richtextfield>
您可以看到我已经启用了所有功能,但这不是我需要的,因为我只需要大胆,斜体和下划线的样式,再加上子弹和编号列表。
任何建议?
感谢
您需要为功能类别添加节点,并启用或禁用此类别的功能。查看文档:
这是一个使用相当有限的RTE的例子:
< 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]/>
< style
jcr:primaryType =nt:unstructured
features =*>
< styles jcr:primaryType =cq:WidgetCollection>
< f125
jcr:primaryType =nt:unstructured
cssName =f125
text =字体大小125%(15px)/>
< f150
jcr:primaryType =nt:unstructured
cssName =f150
text =Font Size 150%(18px)/>
< / styles>
< / styles>
< / rtePlugins>
< / text>
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
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>
这篇关于CQ丰富的文本字段编辑器支持粗体,斜体和下划线样式,仅加上子弹和编号列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!