I want to disable the delete copy move and all the other options for the child components | Community
Skip to main content
Level 2
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
  • 1671 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

GabrielMircea
Level 2
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
Level 2
November 7, 2024

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

GabrielMircea
Level 2
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.

 

kautuk_sahni
Community Manager
Community Manager
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