我正在開發一個自定義容器組件在Adobe CQ5.5,我想有一個自定義消息作爲佔位符,而不是默認的「拖動組件或資產在這裏」。cq:emptyText不工作在Adobe CQ5.5
我發現到現在爲止,我必須添加cq:emptyText =「我的自定義佔位符消息」。可能我錯過了一些東西,因爲這個屬性被完全忽略。這裏是我的組件的文件夾結構基金:
- [clientlib]
- .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,我仍然看到默認的佔位符文本。
任何幫助將不勝感激!
謝謝!
Stan。
UPDATE:
託梅克的建議後,我仍然得到「拖放組件或資產在這裏」,而不是我的自定義消息,所以我仍然尋找一個答案。我的組件的文件結構現在看起來是這樣的: - [clientlib] - [新] ---- .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>
新/ .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"/>
新/ _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" />
感謝您的回覆Tomek。我做了你所建議的一切,但我仍然只看到默認的「在這裏拖動你的組件或資產」。有關更多信息,請參閱上面的更新,我無法將所有內容都放在此處。 – Stan