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

arunpatidar
Community Advisor
Community Advisor
November 11, 2024

Hi @arunpatidar  , I found your assistance incredibly helpful. It would greatly enhance the utility if this approach could be applied to different components rather than just the container component. I really appreciate your support. Thank you so much.

Regards,

Vinith M


Hi @vinithm3 
It can be used with any component, you just need to add container component as supertype

Example : Text-and-Image component

https://github.com/arunpatidar02/aemaacs-aemlab/blob/master/ui.apps/src/main/content/jcr_root/apps/aemlab/oneweb/components/text-and-image/.content.xml 

Arun Patidar
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