Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Custom Actions on AEM component tool bar Touch UI

Avatar

Community Advisor

Hi Team,

I want to add a custom action on my component tool bar in Touch UI.

Now scenario is like -- I have one container component [1]. and inside it I have custom text image component [2] as child of container component [1].

In my container component [1] , I have added a custom action cq:actions --> delete  in cq:EditConfig. and in cq:actionConfigs --> some text [Insert Component] as highlighted in below screenshot.

Capture.PNG

Now when I click on Insert Component on component tool bar, it should insert same custom text image component below to existing one but inside container component [1]. but not in parsys.

so after inserting there will another custom text image component will appear. so in container, I will have two custom text image component after click on Insert Component.

Can someone please help to write function for Insert Component so that it can add another component in container?

Regards,

Prince

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hey Prince - writing a script to add a component to AEM is not a typical way of adding a component to a page. Best practice is to drag and drop from the side rail or include it within the actual template. Why are you trying to add a component via a custom toolbar action? 

ie:

<div data-sly-resource="${'content' @ resourceType='core/wcm/components/list/v1/list'}">

View solution in original post

2 Replies

Avatar

Level 5

you can refer this link for configuring custom cq:action in aem.

Avatar

Correct answer by
Level 10

Hey Prince - writing a script to add a component to AEM is not a typical way of adding a component to a page. Best practice is to drag and drop from the side rail or include it within the actual template. Why are you trying to add a component via a custom toolbar action? 

ie:

<div data-sly-resource="${'content' @ resourceType='core/wcm/components/list/v1/list'}">