How to get the copied component path in cq:editconfig after copy event? | Community
Skip to main content
May 15, 2023
Solved

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

  • May 15, 2023
  • 1 reply
  • 536 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ManviSharma

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.

1 reply

ManviSharma
Adobe Employee
ManviSharmaAdobe EmployeeAccepted solution
Adobe Employee
May 15, 2023

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.