Custom Actions on AEM component tool bar Touch UI | Community
Skip to main content
Prince_Shivhare
New Participant
Jul 29, 2017 7:14 AM UTC
Solved

Custom Actions on AEM component tool bar Touch UI

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.

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
smacdonald2008
smacdonald2008Accepted solution
Level 10
Jul 31, 2017 8:19 PM UTC

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'}">

2 replies

smacdonald2008
smacdonald2008Accepted solution
Level 10
Jul 31, 2017 8:19 PM UTC

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'}">

Translate
Level 4
Jul 31, 2017 9:00 AM UTC

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

Translate