一个组件中有多个cq:dropTargets [英] Having multiple cq:dropTargets in one component

查看:106
本文介绍了一个组件中有多个cq:dropTargets的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用以下可见代码成功地将单个cq:dropTarget实现到我的组件中:

I've managed to implement my single cq:dropTarget into my component with the following sightly code:

<div data-sly-test="${wcmmode.edit}" class="cq-dd-videoplayer" data-sly-text="Drop video here"></div>

cq:dropTargets的设置如下:

And the cq:dropTargets is setup like so:

    <cq:dropTargets jcr:primaryType="nt:unstructured">
        <videoplayer
            jcr:primaryType="cq:DropTargetConfig"
            accept="[video/.*]"
            groups="[media]"
            propertyName="./videoPath"/>
    </cq:dropTargets>

这非常有效...我遇到的问题是在一个cq:dropTargets中有多个零件。我遇到的问题是将资产放到cq:dropTargets之一中时,dropTargets中的两个值都用相同的值更新了。

This works perfectly... The issue I'm having is having multiple cq:dropTargets in the one component. The issue I have is when I drop an asset into one of the cq:dropTargets both values in the dropTargets are updated with the same value.

这是我当前的设置:

很漂亮:

<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

<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通过拖动资产成为相同的值。 / p>

so now the ./videoPath and ./imagePath become the same value from the dragged in asset.

推荐答案

2015年8月22日,发布了一个新的功能包CQ-6.1.0-FEATUREPACK-6563,它解决了此问题。
已修复相关错误:
-CQ-39715-使多个就地编辑器更聪明
-CQ-41631-无法在同一对话框上放置多个文件上传小部件
-CQ -42676-就地编辑不适用于静态包含的组件

On the 22nd of August 2015 has been released a new featurepack CQ-6.1.0-FEATUREPACK-6563 which solved this problem. Related bugs fixed: - CQ-39715 - Make multiple in-place editors smarter - CQ-41631 - Can't place multiple fileupload widgets on the same dialog - CQ-42676 - Inplace editing does not work for static included components

所以现在您需要在cq:inplaceEdit内部创建一个名为cq:childEditors primaryType的非结构化节点,并且在该节点内部对于由两个属性组成的每个元素,键入cq:ChildEditorConfig:标题和类型,其中当您单击编辑链接时,标题将显示在下拉菜单中。我创建了一个3列的图像组件,可以从Content Finder拖放每个图像。

另外,配置部分正在使用3个标签,在其中可以拖放每个图片。

我建议以wcm / foundation / components / textimage为例。
参考: https://docs.adobe.com/docs/zh/aem/6-1/develop/components/multiple-inplace-editors.html

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

这篇关于一个组件中有多个cq:dropTargets的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆