如何在PathField中启用资源拖放功能

在Adobe Experience Manager 6.5.10更新后,现在可以将资源从资源浏览器拖放到页面编辑器上的PathField中。 要启用此功能,请将​ dropable ​属性添加到PathField的节点。

描述 description

环境

Adobe Experience Manager

问题/症状

从AEM 6.5.10开始,您可以将资产从资产浏览器拖放到页面编辑器上的PathField中。 此功能对应于AEM 6.5.10发行说明中的以下行:

站点编辑器中的​ PathField允许作者从内容查找器拖动资产。

本文介绍了如何启用此功能。

解决方法 resolution

将​ dropable ​属性添加到PathField的节点。

name: droppable

  type: Boolean

  value: true

自定义示例:

包含droppable=true的PathField已添加到WKND教程的HelloWorld组件中,如

/apps/wknd/components/helloworld/cq:dialog/content/items/column/items/path/@dropable={Boolean}true

<?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" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
        jcr:primaryType="nt:unstructured"
        jcr:title="Properties"
        sling:resourceType="cq/gui/components/authoring/dialog">
        <content
            jcr:primaryType="nt:unstructured"
            sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
            <items jcr:primaryType="nt:unstructured">
                <column
                    jcr:primaryType="nt:unstructured"
                    sling:resourceType="granite/ui/components/coral/foundation/container">
                    <items jcr:primaryType="nt:unstructured">
                        <text
                            jcr:primaryType="nt:unstructured"
                            sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                            fieldLabel="Text"
                            name="./text"/>
                        <path
                            jcr:primaryType="nt:unstructured"
                            sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
                            fieldLabel="Path"
                            droppable="{Boolean}true"
                            name="./path"/>
                    </items>
                </column>
            </items>
        </content>
    </jcr:root>
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f