我有一個包含多個富文本字段的觸摸UI對話框。有些分佈在多個標籤上。我想添加幾個插件,例如misctools插件,到RTE工具欄。這是如何完成的?AEM 6.1 - 在觸摸UI對話框中的RTE字段上配置富文本編輯器插件
我曾嘗試使用一個rtePlugins節點對話框中的現場節點,一個孩子配置它們,以及對CQ下添加rtePlugins節點:editConfig-> CQ:inplaceEditing節點,但這些方法都沒有變化對話框內的RTE工具欄本身(我不想就地編輯)。
我甚至想做甚麼?
我有一個包含多個富文本字段的觸摸UI對話框。有些分佈在多個標籤上。我想添加幾個插件,例如misctools插件,到RTE工具欄。這是如何完成的?AEM 6.1 - 在觸摸UI對話框中的RTE字段上配置富文本編輯器插件
我曾嘗試使用一個rtePlugins節點對話框中的現場節點,一個孩子配置它們,以及對CQ下添加rtePlugins節點:editConfig-> CQ:inplaceEditing節點,但這些方法都沒有變化對話框內的RTE工具欄本身(我不想就地編輯)。
我甚至想做甚麼?
即使在richtext字段下創建合適的rtePlugins節點或使用cq:inplaceEditing方法後,基本AEM 6.1 jar也存在問題,其中工具欄僅顯示3-5個Richtext對話框按鈕。嘗試安裝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節點下配置的所有插件相對應的按鈕。
您提到您正在使用TouchUI。因此,對話框中沒有touchUI的RTEeditor概念。 RTE「按設計」,在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>
和相應的_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>
更新到我以前的答覆:
HAVE一起來看看這款https://docs.adobe.com/docs/en/aem/6-3/administer/operations/page-authoring/rich-text-editor.html #RTE - 就地並在對話框
這樣看來RTE內的對話實際上是可能的,但它確實有它的問題,如上面的鏈接所述。此外,6.3現在使用CoralUI2,所以上面這個解決方案的工作,但useFixedInlineToolbar =「{}布爾真」的設置已沒有一個對話框內的影響,直到您單擊RTE的textarea裏面的RTE菜單是不可見的。我還沒有解決這個問題。
下面是我只是RTE創造AEM6一個頭錘對話框內的例子。3
<?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>
這可能是與'uiSettings'節點的問題,類似於這裏https://stackoverflow.com/questions/41956596/adding-styles-in-rich-描述真實文本觸摸UI,萬事/ 42181671#42181671 – toniedzwiedz