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

Adobe Experience Manager 6.5.10更新後,現在可以從資產瀏覽器將資產拖放到頁面編輯器上的PathField中。 若要啟用此功能,請將​ 可卸除的 ​屬性新增到PathField的節點。

說明 description

環境

Adobe Experience Manager

問題/症狀

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

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

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

解決方法 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