如何在PathField中啟用資產拖放功能

在AEM 6.5.10更新後,可以從資產瀏覽器將資產拖放至頁面編輯器上的PathField中。 若要啟用此功能,請新增  可丟棄  屬性到PathField的節點。

說明 description

環境

Adobe Experience Manager

問題/症狀

從AEM 6.5.10開始,您可以將資產從資產瀏覽器拖放至頁面編輯器上的PathField中。 此功能對應 AEM 6.5.10發行說明

「Sites編輯器中的PathField可讓作者從Content Finder中拖曳資產。」

本文會說明如何啟用此功能。

解決方法 resolution

將「droppable」屬性新增至PathField的節點。

name: droppable

  type: Boolean

  value: true

自訂範例:

路徑欄位包含 droppable=true,新增至WKND教學課程的HelloWorld元件,如

/apps/wknd/components/helloworld/cq:dialog/content/items/column/items/path:

<?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