Expand my Community achievements bar.

SOLVED

Drop target Image and video in different nodes

Avatar

Level 3

Hi everyone

 

Does anyone knows how can I create a separate node (dropTarget) for image and video ?

Here’s the data in my node:

 

odabio_0-1638477309857.png

 

Im my node video (only video should be accepted in this node):

odabio_1-1638477309863.png

 

 

In node image(only images should be accepted in this node):

odabio_2-1638477309867.png

 

 In my component only images are being accepted when I drag and drop then the videos are not being recognized, any ideas about how can I make the video recognizable ?

 

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

After seeing your query I have tried to add drop target for both image and video in my demo component. So, requesting you to define correct value against 'name' property as I was focusing on dialog editor mainly.

 

content.xml of cq:dialog -

 

DEBAL_DAS_0-1638781968815.png

 

cq:editConfig xml structure 

 

DEBAL_DAS_1-1638782166296.png

 

Please review.

 

View solution in original post

7 Replies

Avatar

Community Advisor

Hi, 
for video, your accept regex is correct?

accept="[video/.*]


Arun Patidar

Avatar

Employee Advisor

I fell if we could define the separate cq:dropTargets for image and video like the below one then it will satisfy the requirement  -

 

DEBAL_DAS_0-1638724819058.png

 

Sharing xml structure of cq:editConfig node for your reference -

 

DEBAL_DAS_1-1638725198622.png

 

If we take a look at the dialog editor as shown below , then you could see 

first file upload is allowing me to upload only image  and second file upload is allowing me to upload mp4 file -

 

DEBAL_DAS_3-1638725532692.png

Please refer this http://www.sgaemsolutions.com/2019/01/cqdroptagets-in-cqeditconfig-node-in-aem.html.

 

 

Avatar

Community Advisor

Hi,

I tried with you node configuration, it works for me.

I just had to allow the video mimetypes in file node

/apps/core/wcm/components/image/v1/image/cq:dialog/content/items/image/items/column/items/file

e.g. 

mimeTypes=image/gif, video/mp4


Arun Patidar

Avatar

Employee Advisor

Yes even I tried the same with mimetypes at the file node. Such as file node associated with video -

 

/apps/demo/components/demovideo/cq:dialog/content/items/column/items/asset/items/columns/items/column/items/video -

DEBAL_DAS_0-1638755649852.png

 

/apps/demo/components/demovideo/cq:dialog/content/items/column/items/asset/items/columns/items/column/items/image

 

Regards,

Debal

File node associated with image- 

DEBAL_DAS_1-1638755709175.png

 

Here is the demo component node hierarchy -

 

DEBAL_DAS_2-1638756346027.png

Please review.

 

Avatar

Level 3

Can I see your xml file (image and video in cq:dialog and cq:dropTargets) ? 

Avatar

Correct answer by
Employee Advisor

After seeing your query I have tried to add drop target for both image and video in my demo component. So, requesting you to define correct value against 'name' property as I was focusing on dialog editor mainly.

 

content.xml of cq:dialog -

 

DEBAL_DAS_0-1638781968815.png

 

cq:editConfig xml structure 

 

DEBAL_DAS_1-1638782166296.png

 

Please review.