【发布时间】:2013-10-07 20:03:01
【问题描述】:
我正在 Adobe CQ5.5 中开发一个自定义容器组件,我希望使用自定义消息作为占位符,而不是默认的“将组件或资源拖到此处”。
到目前为止,我发现我必须添加 cq:emptyText="My custom placeholder message"。可能我错过了一些东西,因为这个属性被完全忽略了。这是我的组件的文件夹结构:
- [客户端库]
- .content.xml
- _cq_editConfig.xml
- dialog.xml
- myContainer.jsp
根据Adobe's official tutorials 和this wonderful tutorial for building an Accordion container,cq:emptyText 应该进入 _cq_editConfig.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"
cq:actions="[edit]"
cq:dialogMode="floating"
cq:emptyText="Drag My Custom components here"
jcr:primaryType="cq:EditConfig">
<cq:listeners
jcr:primaryType="cq:EditListenersConfig"
afteredit="REFRESH_PAGE"/>
</jcr:root>
不幸的是,即使包含 cq:emptyText,我仍然会看到默认占位符文本。
任何帮助将不胜感激!
谢谢!
斯坦。
更新:
在 Tomek 的建议之后,我仍然收到“将组件或资产拖到此处”而不是我的自定义消息,因此我仍在寻找答案。我的组件的文件结构现在如下所示: - [客户端库] - [新的] ---- .content.xml ---- _cq_editConfig.xml - .content.xml - _cq_editConfig.xml - 对话框.xml - tabContainer.jsp
.content.xml
<?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"
cq:isContainer="{Boolean}true"
jcr:primaryType="cq:Component"
jcr:title="Tab Container"
jcr:description="Container component for tab pages"
sling:resourceSuperType="foundation/components/parsys"
componentGroup="MyComponents"/>
_cq_editConfig.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"
cq:actions="[edit]"
cq:dialogMode="floating"
jcr:primaryType="cq:EditConfig">
<cq:listeners
jcr:primaryType="cq:EditListenersConfig"
afteredit="REFRESH_PAGE"/>
</jcr:root>
new/.content.xml
<?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"
jcr:primaryType="cq:Component"
jcr:title="New Paragraph"
sling:resourceType="foundation/components/parsys/new"
componentGroup=".hidden"/>
new/_cq_editConfig.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"
cq:actions="[_clear,insert]"
cq:emptyText="Drag My Custom components here"
jcr:primaryType="cq:EditConfig" />
【问题讨论】:
标签: adobe components containers aem