I want to disable the delete copy move and all the other options for the child components | Community
Skip to main content
New Participant
November 7, 2024
Solved

I want to disable the delete copy move and all the other options for the child components

  • November 7, 2024
  • 2 replies
  • 1669 views

Lets imagine I have the following components in my AEM project [Using AEM as Cloud]

Component A

Component B

Component C

Now I want to create a new component (Component D) which contains Component A,B and some additional new things. I have added Component A and B using cq:template. SO when we add component D to the page the child nodes for component A and B will be automatically created. 

 

Everything is working as expected till now. I can edit the properties of A and B individually using edit toolbar. But I want to disable the delete copy and paste options for the embedded component A and B.

So is there any way to disable/remove delete copy and paste options for child component ?

I found a solution given by @gaurav-behl but I am not able to open the link Gaurav if possible can u please look into it and provide the solution since you know the solution. Or anyone knows the solution please provide it

 

Regards

Vinith M 

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

2 replies

kautuk_sahni
Employee
November 25, 2024

@vinithm3 Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Kautuk Sahni
GabrielMircea
New Participant
November 7, 2024

in Component A and B Node Configuration:

 

Within the jcr:content nodes of Component A and Component B (under Component D's structure), add the cq:actions property.Set cq:actions to exclude the actions you want to disable.

 

cq:actions = ["edit"]

 

 

By setting it to only "edit", you will restrict the toolbar to show only the edit action, effectively hiding delete, copy, and paste actions.

 

Vinithm3Author
New Participant
November 7, 2024

Hi @gabrielmircea  this works but the option gets applied for the parent component as well

GabrielMircea
New Participant
November 7, 2024

 

If you’re adding this property to Component D's template definition or its children, ensure you’re targeting the embedded instances of Components A and B.

 

Navigate to ComponentD > jcr:content where Component A and B are defined and add cq:actions directly to each of those child nodes.