【发布时间】:2016-05-19 11:08:06
【问题描述】:
我为 AEM 中的 RTE 设置了默认值。该值在对话框首次打开时显示正确,但是当它被保存并重新打开时,href 已从 A 标记中删除。 (这是一个外部链接)
如果然后使用 RTE 链接按钮重新添加此 href,则它可以正常工作,但我自然希望它第一次正常工作。
我是 AEM 新手,目前有以下内容(注意:对于本示例,我已更改 URL 并复制到测试版本):
<branchResultsCopy
jcr:primaryType="cq:Widget"
externalStyleSheets="[/etc/designs/rtg/clientlibs/author/style/source/rte.css]"
fieldLabel="Branch results copy"
name="./branchresultscopy"
defaultValue="<p>If you'd like information about blah blah blah, visit our <a target='_blank' link-checker='skip' href='https://www.testurl.com'>Link text</a> page.</p>"
xtype="richtext">
<htmlRules
jcr:primaryType="nt:unstructured">
<links
jcr:primaryType="nt:unstructured"
protocols="[http://,https://]"/>
</htmlRules>
<rtePlugins
jcr:primaryType="nt:unstructured">
<edit
jcr:primaryType="nt:unstructured">
<htmlPasteRules
jcr:primaryType="nt:unstructured">
<allowBasics
jcr:primaryType="nt:unstructured"
anchor="{Boolean}true"
bold="{Boolean}true"
/>
</htmlPasteRules>
</edit>
<format
jcr:primaryType="nt:unstructured"
features="[bold,italic]"/>
<lists
jcr:primaryType="nt:unstructured"
features="[ordered,unordered]"/>
<links
jcr:primaryType="nt:unstructured"
features="*"/>
</rtePlugins>
</branchResultsCopy>
【问题讨论】:
-
您使用的链接是否有效(我假设示例是虚拟 url)?也许即使使用 link-checker='skip' (从未听说过),链接也会被链接检查器剥离。
-
谢谢 Thomas,我检查了,我的真实代码中的 URL 将指向一个有效的链接。