我已成功使用以下代码将单个 cq:dropTarget 实现到我的组件中:
<div data-sly-test="${wcmmode.edit}" class="cq-dd-videoplayer" data-sly-text="Drop video here"></div>
cq:dropTargets 设置如下:
<cq:dropTargets jcr:primaryType="nt:unstructured">
<videoplayer
jcr:primaryType="cq:DropTargetConfig"
accept="[video/.*]"
groups="[media]"
propertyName="./videoPath"/>
</cq:dropTargets>
这完美地工作...我遇到的问题是在一个组件中有多个 cq:dropTargets 。我遇到的问题是,当我将资产放入 cq:dropTargets 之一时,dropTargets 中的两个值都会更新为相同的值。
这是我当前的设置:
Sightly:
<div data-sly-test="${wcmmode.edit}" class="cq-dd-videoplayer cq-video-placeholder cq-block-sm-placeholder md-dropzone-video" data-sly-text="Drop video here"></div>
<div data-sly-test="${wcmmode.edit}" class="cq-dd-imageofplayer cq-video-placeholder cq-block-sm-placeholder md-dropzone-video" data-sly-text="Drop image here"></div>
cq:dropTargets
<cq:dropTargets jcr:primaryType="nt:unstructured">
<videoplayer
jcr:primaryType="cq:DropTargetConfig"
accept="[video/.*]"
groups="[media]"
propertyName="./videoPath"/>
<imageofplayer
jcr:primaryType="cq:DropTargetConfig"
accept="[image/.*]"
groups="[media]"
propertyName="./imagePath"/>
</cq:dropTargets>
所以现在 ./videoPath 和 ./imagePath 与拖入资源中的值相同。
2015 年 8 月 22 日发布了新的功能包 CQ-6.1.0-FEATUREPACK-6563,解决了这个问题。
相关错误修复:
- CQ-39715 - 使多个就地编辑器更加智能
- CQ-41631 - 无法在同一对话框上放置多个文件上传小部件
- CQ-42676 - 就地编辑不适用于静态包含的组件
So now you need to create inside cq:inplaceEditing a node called cq:childEditors primaryType unstructured and inside that one node type cq:ChildEditorConfig for each element composed by two properties: "title" and "type" where title will be showed in a dropdown menu when you click on the edit link. I created a 3 columns image component and I can drag-and-drop images from the Content Finder for each of them.
Also the Configure section is working with 3 tabs where I can drag-and-drop/upload images for each of them.
I suggest to use wcm/foundation/components/textimage as example.
References: https://docs.adobe.com/docs/en/aem/6-1/develop/components/multiple-inplace-editors.html https://docs.adobe.com/docs/en/aem/6-1/develop/components/multiple-inplace-editors.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)