Expand my Community achievements bar.

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

Avatar

Level 1

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 

7 Replies

Avatar

Level 2

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.

 

Avatar

Level 1

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

Avatar

Level 2

 

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.

 

Avatar

Level 5

@Vinithm2I am also curious if it worked to have D back as it was. Please let me know. If not, maybe worth trying to explicitly add cq:actions on D and see how all 2 components behaves.

Avatar

Level 1

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

Avatar

Community Advisor

Hi @Vinithm2 
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/a... 



Arun Patidar