Adobe CQ5.5 でカスタム コンテナ コンポーネントを開発しています。デフォルトの「コンポーネントまたはアセットをここにドラッグ」の代わりにカスタム メッセージをプレースホルダとして使用したいと考えています。
これまでにわかったことは、cq:emptyText="My custom placeholder message" を追加する必要があるということです。このプロパティは完全に無視されるため、おそらく何かが欠けています。コンポーネントのフォルダー構造は次のとおりです。
- [クライアントライブラリ]
- .content.xml
- _cq_editConfig.xml
- dialog.xml
- myContainer.jsp
Adobe の公式チュートリアルと、Accordion コンテナを構築するためのこのすばらしいチュートリアルによると、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 の提案の後、カスタム メッセージの代わりに「ここにコンポーネントまたはアセットをドラッグしてください」というメッセージが表示されるので、まだ回答を探しています。コンポーネントのファイル構造は次のようになりました: - [clientlib] - [new] ---- .content.xml ---- _cq_editConfig.xml - .content.xml - _cq_editConfig.xml - dialog.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" />