Highlighted

Drag and drop from siderail with custom mimetype

svbeek

24-11-2017

Hi all,

We're migrating a custom drag and drop functionality from the classic UI to the touch UI. It involves drag and drop of custom mimetypes (in this case books) on a custom component in the page. Dragging works fine, but on dropping nothing happens. No error in the console and also not in the logs.

This is the droptarget section in editconfig of the component on the page:

<cq:dropTargets jcr:primaryType="nt:unstructured">

   <contentprofile
   jcr:primaryType="cq:DropTargetConfig"
   accept="[contentprofile/metatags]"
   groups="[media]"
   propertyName="./metatags">

   <parameters
   jcr:primaryType="nt:unstructured"
   sling:resourceType="website/components/metatag"
   mode="external"/>

   </contentprofile>

</cq:dropTargets>

And this is the html from one of the draggable cards in the siderail:

<article class="card-metatag cq-draggable" draggable="true" data-path="/path/to/data" data-asset-group="media" data-param="{}" data-type="Images" data-asset-mimetype="contentprofile/metatags"><i class="select"></i><i class="move"></i><div class="card"><span class="image"><img class="show-grid cq-dd-contentprofile" src="/path/to/image.jpg" alt=""></span><a href="#" class="label"><h4>My custom draggable</h4></a></div></article>

Question 1: Are there any erros in the above configuration, or am i missing something?

Question 2: When i look at the OOTB implementation of drag and drop for assets, i see some data attributes that are not documented. Can someone explain me what these are for?

data-param

data-type

Replies

Highlighted

svbeek

24-11-2017

Hi,

Sorry, I think i may not have been fully clear. The question is about dragging custom 'asset' types from the contentfinder/siderail on a custom component.  For sure that won't work on the we retail site since those components will not accept the mimetype we configured on our assets.

Highlighted

smacdonald2008

24-11-2017

OK - custom MIMT TYPES on an asset. This is not a documented use case - we will pass this to the team to see their thoughts.

Highlighted

svbeek

26-11-2017

Hi,

That stackoverflow seems to have more to do with serving assets that have a custom xtype. Mine is about the drag and drop functionality.