我有一个包含多个Rich Text字段的Touch UI对话框。有些分布在几个标签上。我想在RTE工具栏中添加几个插件,例如misctools插件。这是如何完成的?
我尝试使用rtePlugins节点作为对话框中字段节点的子节点来配置它们,以及在cq:editConfig-> cq:inplaceEditing节点下添加rtePlugins节点,但这些方法都没有改变对话框内的RTE工具栏(我不想进行就地编辑)。
我想做什么甚至可能?
答案 0 :(得分:1)
更新我以前的答案:
了解https://docs.adobe.com/docs/en/aem/6-3/administer/operations/page-authoring/rich-text-editor.html #RTE - 就地和对话
在对话框中看起来RTE实际上是可行的,但它确实存在问题,如上面链接中所述。另外,6.3现在使用CoralUI2,所以上面的解决方案确实有效,但是useFixedInlineToolbar =“{Boolean} true”的设置在对话框内没有任何影响,只有在RTE文本区域内单击后才能看到RTE菜单。我还没有解决这个问题。
这是我刚刚在AEM6.3中的touchUI对话框中为RTE创建的示例
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" 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="nt:unstructured"
jcr:title="Properties"
sling:resourceType="cq/gui/components/authoring/dialog">
<content
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container">
<layout
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"/>
<items jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container">
<items jcr:primaryType="nt:unstructured">
<regulartext
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
fieldLabel="Text"
name="./regulartext"/>
<text jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/richtext"
fieldLabel="RICH As Text"
name="./text"
useFixedInlineToolbar="{Boolean}true">
<rtePlugins jcr:primaryType="nt:unstructured">
<edit
jcr:primaryType="nt:unstructured"
defaultPasteMode="wordhtml"
features="[cut,copy,paste-plaintext,paste-wordhtml]"
stripHtmlTags="{Boolean}true"/>
<findreplace
jcr:primaryType="nt:unstructured"
features="*"/>
<format
jcr:primaryType="nt:unstructured"
features="*"/>
<image
jcr:primaryType="nt:unstructured"
features="*"/>
<justify
jcr:primaryType="nt:unstructured"
features="*"/>
<links jcr:primaryType="nt:unstructured">
<linkDialogConfig
jcr:primaryType="nt:unstructured"
height="{Long}316">
<linkAttributes jcr:primaryType="cq:WidgetCollection">
<linkAdvanced
jcr:primaryType="cq:Widget"
collapsed="{Boolean}true"
collapsible="{Boolean}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>
<lists
jcr:primaryType="nt:unstructured"
features="*"/>
<misctools
jcr:primaryType="nt:unstructured"
features="*">
<specialCharsConfig jcr:primaryType="nt:unstructured">
<chars jcr:primaryType="nt:unstructured">
<copyright
jcr:primaryType="nt:unstructured"
entity="©"/>
<trademark
jcr:primaryType="nt:unstructured"
entity="™"/>
<registered
jcr:primaryType="nt:unstructured"
entity="®"/>
<emDash
jcr:primaryType="nt:unstructured"
entity="—"/>
<dagger
jcr:primaryType="nt:unstructured"
entity="†"/>
<doubleDagger
jcr:primaryType="nt:unstructured"
entity="‡"/>
</chars>
</specialCharsConfig>
</misctools>
<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"/>
<h6
jcr:primaryType="nt:unstructured"
description="Heading 6"
tag="h6"/>
</formats>
</paraformat>
<spellcheck
jcr:primaryType="nt:unstructured"
features="*"
invalidStyle="background-color: #ffdddd;"/>
<styles
jcr:primaryType="nt:unstructured"
features="*">
<styles jcr:primaryType="cq:WidgetCollection">
<disclaimer
jcr:primaryType="nt:unstructured"
cssName="small"
text="Disclaimer"/>
</styles>
</styles>
<subsuperscript
jcr:primaryType="nt:unstructured"
features="*"/>
<table
jcr:primaryType="nt:unstructured"
features="*"/>
<undo
jcr:primaryType="nt:unstructured"
features="*"/>
</rtePlugins>
<htmlRules jcr:primaryType="nt:unstructured">
<docType jcr:primaryType="nt:unstructured">
<typeConfig
jcr:primaryType="nt:unstructured"
useSemanticMarkup="{Boolean}true"/>
</docType>
</htmlRules>
<uiSettings jcr:primaryType="nt:unstructured">
<cui jcr:primaryType="nt:unstructured">
<inline
jcr:primaryType="nt:unstructured"
toolbar="[#format,-,#justify,-,#lists,-,links#modifylink,links#unlink,links#anchor,-,#styles,#paraformat,-,subsuperscript#subscript,subsuperscript#superscript,-,edit#cut,edit#copy,edit#paste-plaintext,edit#paste-wordhtml,-,findreplace#find,findreplace#replace,-,undo#undo,undo#redo,-,spellcheck#checktext,-,misctools#specialchars,-,#styles,#paraformat,-,table#table]">
<popovers jcr:primaryType="nt:unstructured">
<format
jcr:primaryType="nt:unstructured"
items="[format#bold,format#italic,format#underline]"
ref="format"/>
<justify
jcr:primaryType="nt:unstructured"
items="[justify#justifyleft,justify#justifycenter,justify#justifyright]"
ref="justify"/>
<lists
jcr:primaryType="nt:unstructured"
items="[lists#unordered,lists#ordered,lists#outdent,lists#indent]"
ref="lists"/>
<styles
jcr:primaryType="nt:unstructured"
items="styles:getStyles:styles-pulldown"
ref="styles"/>
<paraformat
jcr:primaryType="nt:unstructured"
items="paraformat:getFormats:paraformat-pulldown"
ref="paraformat"/>
</popovers>
</inline>
<!--<fullscreen-->
<!--jcr:primaryType="nt:unstructured"-->
<!--toolbar="[#format,-,subsuperscript#subscript,subsuperscript#superscript,-,edit#cut,edit#copy,edit#paste-plaintext,edit#paste-wordhtml,-,findreplace#find,findreplace#replace,-,undo#undo,undo#redo,-#justify,-,links#modifylink,links#unlink,links#anchor,-,#lists,-,spellcheck#checktext,-,misctools#specialchars,-,#styles,#paraformat,-,table#table,-,fullscreen#finish,-,control#close,control#save]">-->
<!--<popovers jcr:primaryType="nt:unstructured">-->
<!--<format-->
<!--jcr:primaryType="nt:unstructured"-->
<!--items="[format#bold,format#italic,format#underline]"-->
<!--ref="format"/>-->
<!--<justify-->
<!--jcr:primaryType="nt:unstructured"-->
<!--items="[justify#justifyleft,justify#justifycenter,justify#justifyright]"-->
<!--ref="justify"/>-->
<!--<lists-->
<!--jcr:primaryType="nt:unstructured"-->
<!--items="[lists#unordered,lists#ordered,lists#outdent,lists#indent]"-->
<!--ref="lists"/>-->
<!--<styles-->
<!--jcr:primaryType="nt:unstructured"-->
<!--items="styles:getStyles:styles-pulldown"-->
<!--ref="styles"/>-->
<!--<paraformat-->
<!--jcr:primaryType="nt:unstructured"-->
<!--items="paraformat:getFormats:paraformat-pulldown"-->
<!--ref="paraformat"/>-->
<!--</popovers>-->
<!--</fullscreen>-->
<tableEditOptions
jcr:primaryType="nt:unstructured"
toolbar="[table#insertcolumn-before,table#insertcolumn-after,table#removecolumn,-,table#insertrow-before,table#insertrow-after,table#removerow,-,table#mergecells-right,table#mergecells-down,table#mergecells,table#splitcell-horizontal,table#splitcell-vertical,-,table#selectrow,table#selectcolumn,-,table#ensureparagraph,-,table#modifytableandcell,table#removetable,-,undo#undo,undo#redo,-,table#exitTableEditing,-]"/>
</cui>
</uiSettings>
</text>
</items>
</column>
</items>
</content>
</jcr:root>
答案 1 :(得分:0)
基本AEM 6.1 jar存在问题,即使在richtext字段下创建了正确的rtePlugins节点或使用cq:inplaceEditing方法,工具栏也只显示了Richtext对话框字段的3-5个按钮。尝试安装AEM 6.1 Service Pack软件包和错误修复软件包。您可以在Adobe的网站上找到它:https://www.adobeaemcloud.com/content/marketplace/marketplaceProxy.html?packagePath=/content/companies/public/adobe/packages/cq610/servicepack/AEM-6.1-Service-Pack-1。我提供了SP1的路径,这应该足以解决您的问题。您还可以选择SP2加累积错误修复程序包(处理其他问题)。之后,您将能够看到与rtePlugins节点下您配置的所有插件相对应的按钮。
答案 2 :(得分:0)
您提到您正在使用TouchUI。因此,对话框中没有RTEeditor的touchUI概念。 RTE&#34;按设计&#34;,在TouchUI中内嵌。也就是说,如果您双击内联RTE或从工具菜单中单击扳手,则会在TouchUI对话框中显示classicUI RTE。
因此,在回答您的问题时,在对话框中不再存在多个RTE的概念,您可能需要重新考虑组件的设计。
参考在RTE上扩展工具栏,你需要根据你想要的菜单选项添加uiSettings,内联和全屏。
这是一个示例RTE dialog.xml,几乎启用了所有插件:
<?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"
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%"
title="Text"
xtype="panel">
<items jcr:primaryType="cq:WidgetCollection">
<text
jcr:primaryType="cq:Widget"
hideLabel="{Boolean}true"
name="./text"
useFixedInlineToolbar="{Boolean}true"
xtype="richtext">
<rtePlugins jcr:primaryType="nt:unstructured">
<edit
jcr:primaryType="nt:unstructured"
defaultPasteMode="wordhtml"
features="[cut,copy,paste-plaintext,paste-wordhtml]"
stripHtmlTags="{Boolean}true"/>
<findreplace
jcr:primaryType="nt:unstructured"
features="*"/>
<format
jcr:primaryType="nt:unstructured"
features="*"/>
<image
jcr:primaryType="nt:unstructured"
features="*"/>
<justify
jcr:primaryType="nt:unstructured"
features="*"/>
<links jcr:primaryType="nt:unstructured">
<linkDialogConfig
jcr:primaryType="nt:unstructured"
height="{Long}316">
<linkAttributes jcr:primaryType="cq:WidgetCollection">
<linkAdvanced
jcr:primaryType="cq:Widget"
collapsed="{Boolean}true"
collapsible="{Boolean}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>
<lists
jcr:primaryType="nt:unstructured"
features="*"/>
<misctools
jcr:primaryType="nt:unstructured"
features="*">
<specialCharsConfig jcr:primaryType="nt:unstructured">
<chars jcr:primaryType="nt:unstructured">
<copyright
jcr:primaryType="nt:unstructured"
entity="©"/>
<trademark
jcr:primaryType="nt:unstructured"
entity="™"/>
<registered
jcr:primaryType="nt:unstructured"
entity="®"/>
<emDash
jcr:primaryType="nt:unstructured"
entity="—"/>
<dagger
jcr:primaryType="nt:unstructured"
entity="†"/>
<doubleDagger
jcr:primaryType="nt:unstructured"
entity="‡"/>
</chars>
</specialCharsConfig>
</misctools>
<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"/>
<h6
jcr:primaryType="nt:unstructured"
description="Heading 6"
tag="h6"/>
</formats>
</paraformat>
<spellcheck
jcr:primaryType="nt:unstructured"
features="*"
invalidStyle="background-color: #ffdddd;"/>
<styles
jcr:primaryType="nt:unstructured"
features="*">
<styles jcr:primaryType="cq:WidgetCollection">
<disclaimer
jcr:primaryType="nt:unstructured"
cssName="small"
text="Disclaimer"/>
</styles>
</styles>
<subsuperscript
jcr:primaryType="nt:unstructured"
features="*"/>
<table
jcr:primaryType="nt:unstructured"
features="*"/>
<undo
jcr:primaryType="nt:unstructured"
features="*"/>
</rtePlugins>
<htmlRules jcr:primaryType="nt:unstructured">
<docType jcr:primaryType="nt:unstructured">
<typeConfig
jcr:primaryType="nt:unstructured"
useSemanticMarkup="{Boolean}true"/>
</docType>
</htmlRules>
<uiSettings jcr:primaryType="nt:unstructured">
<cui jcr:primaryType="nt:unstructured">
<inline
jcr:primaryType="nt:unstructured"
toolbar="[#format,-,#justify,-,#lists,-,links#modifylink,links#unlink,links#anchor,-,#styles,#paraformat,-,fullscreen#start,-,control#close,control#save]">
<popovers jcr:primaryType="nt:unstructured">
<format
jcr:primaryType="nt:unstructured"
items="[format#bold,format#italic,format#underline]"
ref="format"/>
<justify
jcr:primaryType="nt:unstructured"
items="[justify#justifyleft,justify#justifycenter,justify#justifyright]"
ref="justify"/>
<lists
jcr:primaryType="nt:unstructured"
items="[lists#unordered,lists#ordered,lists#outdent,lists#indent]"
ref="lists"/>
<styles
jcr:primaryType="nt:unstructured"
items="styles:getStyles:styles-pulldown"
ref="styles"/>
<paraformat
jcr:primaryType="nt:unstructured"
items="paraformat:getFormats:paraformat-pulldown"
ref="paraformat"/>
</popovers>
</inline>
<fullscreen
jcr:primaryType="nt:unstructured"
toolbar="[#format,-,subsuperscript#subscript,subsuperscript#superscript,-,edit#cut,edit#copy,edit#paste-plaintext,edit#paste-wordhtml,-,findreplace#find,findreplace#replace,-,undo#undo,undo#redo,-#justify,-,links#modifylink,links#unlink,links#anchor,-,#lists,-,spellcheck#checktext,-,misctools#specialchars,-,#styles,#paraformat,-,table#table,-,fullscreen#finish,-,control#close,control#save]">
<popovers jcr:primaryType="nt:unstructured">
<format
jcr:primaryType="nt:unstructured"
items="[format#bold,format#italic,format#underline]"
ref="format"/>
<justify
jcr:primaryType="nt:unstructured"
items="[justify#justifyleft,justify#justifycenter,justify#justifyright]"
ref="justify"/>
<lists
jcr:primaryType="nt:unstructured"
items="[lists#unordered,lists#ordered,lists#outdent,lists#indent]"
ref="lists"/>
<styles
jcr:primaryType="nt:unstructured"
items="styles:getStyles:styles-pulldown"
ref="styles"/>
<paraformat
jcr:primaryType="nt:unstructured"
items="paraformat:getFormats:paraformat-pulldown"
ref="paraformat"/>
</popovers>
</fullscreen>
<tableEditOptions
jcr:primaryType="nt:unstructured"
toolbar="[table#insertcolumn-before,table#insertcolumn-after,table#removecolumn,-,table#insertrow-before,table#insertrow-after,table#removerow,-,table#mergecells-right,table#mergecells-down,table#mergecells,table#splitcell-horizontal,table#splitcell-vertical,-,table#selectrow,table#selectcolumn,-,table#ensureparagraph,-,table#modifytableandcell,table#removetable,-,undo#undo,undo#redo,-,table#exitTableEditing,-]"/>
</cui>
</uiSettings>
</text>
<isRichTextFlag
jcr:primaryType="cq:Widget"
ignoreData="{Boolean}true"
name="./textIsRich"
value="true"
xtype="hidden"/>
</items>
</tab1>
<tab2
jcr:primaryType="cq:Widget"
anchor="100%"
title="Configurations"
xtype="panel">
<items jcr:primaryType="cq:WidgetCollection">
<noStackFlag
jcr:primaryType="cq:Widget"
fieldLabel="Enable No Stack"
name="./noStack"
type="select"
xtype="selection">
<options jcr:primaryType="cq:WidgetCollection">
<yes
jcr:primaryType="nt:unstructured"
text="Yes"
value="yes"/>
<no
jcr:primaryType="nt:unstructured"
text="No"
value="no"/>
</options>
</noStackFlag>
</items>
</tab2>
</items>
</jcr:root>
&#13;
和相应的_cq_eeditConfig.xml
<?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"
jcr:primaryType="cq:EditConfig">
<cq:inplaceEditing
jcr:primaryType="cq:InplaceEditingConfig"
active="{Boolean}true"
configPath="../../dialog/items/tab1/items/text"
editorType="text"/>
<cq:listeners
jcr:primaryType="cq:EditListenersConfig"
afteredit="REFRESH_SELF"/>
</jcr:root>
&#13;