Expand my Community achievements bar.

SOLVED

How to get the copied component path in cq:editconfig after copy event?

Avatar

Level 1

We have a require to do some operations on the copied component. So for that we have written a listener(aftercopy event).

Using aftercopy property after copying and pasting the component we are able to capture only the source component path only and not the copied component path. Can you please help us how to get the copied component path.

 

Attached below sample code snippet we are using:

 

Property added under cq:listeners node in cq:editconfig

aftercopy - function () {Granite.author.Myproject.aftercopy(this);}

 

 

(function (ns) {

'use strict';

ns.Myproject= ns.demo2 || {};
ns.Myproject.aftercopy = function (component) {

 

alert(component.path); //This always giving the source component path, how to get the copied component path here?

};


}(Granite.author));

 

Your help is highly appreciated. Thank you

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

 

The aftercopy listener in the provided code snippet is only able to capture the source component path and not the copied component path. The requester needs help in getting the copied component path.

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

Hi,

 

The aftercopy listener in the provided code snippet is only able to capture the source component path and not the copied component path. The requester needs help in getting the copied component path.