Aem 向RTE添加样式(CQ5.4)
我用的是5.4。我正在尝试将样式添加到rte上的下拉样式框中。我按照上面的说明做了。在text/rtePlugins/styles/styles下添加节点后,插件的所有选项都将被禁用。粗体、斜体、下划线等按钮。。。不再可以单击。虽然我仍然可以从“副格式”和“样式”下拉列表中选择样式,但它们不会更改文本的外观。此外,尽管我可以在rte中更改文本,但单击“确定”后,更改不会反映在页面中 我已附加对话框节点的节点层次结构快照。请让我知道我是否应该包括任何其他信息Aem 向RTE添加样式(CQ5.4),aem,rte,Aem,Rte,我用的是5.4。我正在尝试将样式添加到rte上的下拉样式框中。我按照上面的说明做了。在text/rtePlugins/styles/styles下添加节点后,插件的所有选项都将被禁用。粗体、斜体、下划线等按钮。。。不再可以单击。虽然我仍然可以从“副格式”和“样式”下拉列表中选择样式,但它们不会更改文本的外观。此外,尽管我可以在rte中更改文本,但单击“确定”后,更改不会反映在页面中 我已附加对话框节点的节点层次结构快照。请让我知道我是否应该包括任何其他信息 谢谢 整个结构是你自己创建的还是从某处
谢谢 整个结构是你自己创建的还是从某处复制的? 您需要确保的是使用*启用每种类型或所有类型的某些功能: 下面是“样式”节点的示例:
<styles
jcr:primaryType="nt:unstructured"
features="*">
<styles jcr:primaryType="cq:WidgetCollection">
[...]
</styles>
</styles>
我建议只为RTE创建一个,其中只包含您在样式列表中添加的样式。我按照此处的说明操作,它对我有效: 正文 生成的对话框如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Dialog"
externalStyleSheets="[/etc/designs/myDesign/css/my_colors.css]"
height="500"
width="700"
xtype="dialog">
<items
jcr:primaryType="nt:unstructured"
helpPath="en/cq/current/wcm/default_components.html#Text"
title="Text"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<tab1
jcr:primaryType="cq:Widget"
anchor="100%"
height="350"
title="Text"
xtype="panel">
<items jcr:primaryType="cq:WidgetCollection">
<text
jcr:primaryType="cq:Widget"
allowBlank="false"
blankText=""
disabled="false"
emptyText=""
fieldDescription=""
fieldLabel=""
fieldSubLabel=""
grow="false"
height="{Long}350"
hideLabel="true"
hideMode=""
inputType=""
maxLength=""
maxLengthText=""
minLength=""
minLengthText=""
msgTarget=""
name="./text"
readOnly="false"
regex=""
regexText=""
selectOnFocus="false"
validateOnBlur="true"
validationDelay=""
validationEvent=""
validator=""
vtype=""
vtypeText=""
xtype="richtext">
<rtePlugins jcr:primaryType="nt:unstructured">
<links jcr:primaryType="nt:unstructured">
<linkDialogConfig
jcr:primaryType="nt:unstructured"
height="316">
<linkAttributes jcr:primaryType="cq:WidgetCollection">
<linkAdvanced
jcr:primaryType="cq:Widget"
collapsed="true"
collapsible="true"
inputValue="advanced"
name="./linkdialog/cq:adhocLinkTrackingTab"
title="Link tracking"
xtype="dialogfieldset">
<items jcr:primaryType="cq:WidgetCollection">
<enable
jcr:primaryType="nt:unstructured"
attribute="enabletracking"
fieldDescription="override analytics framework settings"
fieldLabel="Custom link tracking"
name="./linkdialog/cq:adhocLinkTrackingEnableTracking"
xtype="checkbox">
<listeners
jcr:primaryType="nt:unstructured"
check="function(component){var dlg=component.findParentByType('rtelinkdialog');dlg.enableSCFields(component.checked);}"/>
</enable>
<events
jcr:primaryType="nt:unstructured"
attribute="adhocevents"
fieldDescription="e.g.: event2, event7"
fieldLabel="Include SiteCatalyst events"
name="./linkdialog/cq:adhocLinkTrackingEvents"
xtype="textfield"/>
<evars
jcr:primaryType="nt:unstructured"
attribute="adhocevars"
fieldDescription="e.g.: eVar1: pagedata.url, prop4: 'const'"
fieldLabel="Include SiteCatalyst variables"
name="./linkdialog/cq:adhocLinkTrackingEvars"
xtype="textfield"/>
</items>
</linkAdvanced>
</linkAttributes>
</linkDialogConfig>
</links>
<misctools
jcr:primaryType="nt:unstructured"
features="*"/>
<edit
jcr:primaryType="nt:unstructured"
features="*"/>
<findreplace
jcr:primaryType="nt:unstructured"
features="*"/>
<format
jcr:primaryType="nt:unstructured"
features="*"/>
<image
jcr:primaryType="nt:unstructured"
features="*"/>
<keys
jcr:primaryType="nt:unstructured"
features="*"/>
<justify
jcr:primaryType="nt:unstructured"
features="*"/>
<lists
jcr:primaryType="nt:unstructured"
features="*"/>
<paraformat
jcr:primaryType="nt:unstructured"
features="*"/>
<spellcheck
jcr:primaryType="nt:unstructured"
features="*"/>
<styles
jcr:primaryType="nt:unstructured"
features="*">
<styles jcr:primaryType="cq:WidgetCollection">
<Aqua
jcr:primaryType="nt:unstructured"
cssName="Aqua"
text="Aqua"/>
</styles>
</styles>
<subsuperscript
jcr:primaryType="nt:unstructured"
features="*"/>
<table
jcr:primaryType="nt:unstructured"
features="*"/>
<undo
jcr:primaryType="nt:unstructured"
features="*"/>
</rtePlugins>
</text>
<isRichTextFlag
jcr:primaryType="cq:Widget"
ignoreData="true"
name="./textIsRich"
value="true"
xtype="hidden"/>
</items>
</tab1>
<tab2
jcr:primaryType="cq:Widget"
xtype="componentstyles"/>
</items>
</items>
</jcr:root>
.Aqua { color: Aqua; }
以及节点:
希望这有帮助
-乔尔。我自己创建了这个结构。我确实使用*启用了所有功能。我还在我的文本节点上提供了CSS文件,并尝试使用clientlibs引用样式表。我将尝试为样式列表中的样式创建一个单独的样式表。单独的样式表没有帮助。能否提供一个包含文本组件和引用CSS的内容包?也许我有时间仔细看看,尽管我目前只有运行5.6.1的实例可供我使用。但据我记忆所及,RTE没有任何变化。
externalStyleSheets="[/etc/designs/myDesign/css/my_colors.css]"
<styles
jcr:primaryType="nt:unstructured"
features="*">
<styles jcr:primaryType="cq:WidgetCollection">
<Aqua
jcr:primaryType="nt:unstructured"
cssName="Aqua"
text="Aqua"/>
</styles>
</styles>
.Aqua { color: Aqua; }