Edit bar | Community
Skip to main content
New Member
October 16, 2015
Solved

Edit bar

  • October 16, 2015
  • 4 replies
  • 1267 views

How can I add my own button to edit bar of component? I can't find a source JS code...

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Runal_Trivedi

In case you want to customize the behavior of edit button then yes you will need to overlay EditBar.js.

But if you simply want to create your custom action in editBar like edit button then you can follow below steps:

  1. create cq:editConfig node for your component
  2. create a child node of cq:editConfig of type nt:unstructured having name - cq:actionConfigs
  3. under cq:actionConfigs you can create custom buttons in form of nodes and create their corresponding JS handlers (follow example shared on dev.day link - http://dev.day.com/docs/en/cq/5-5/developing/components/edit_config.html#cq:actionConfigs)
    • so on click of button, the attached js function will be invoked where you can write whatever you need to achieve on click of your custom button.

4 replies

Runal_Trivedi
Runal_TrivediAccepted solution
Level 6
October 16, 2015

In case you want to customize the behavior of edit button then yes you will need to overlay EditBar.js.

But if you simply want to create your custom action in editBar like edit button then you can follow below steps:

  1. create cq:editConfig node for your component
  2. create a child node of cq:editConfig of type nt:unstructured having name - cq:actionConfigs
  3. under cq:actionConfigs you can create custom buttons in form of nodes and create their corresponding JS handlers (follow example shared on dev.day link - http://dev.day.com/docs/en/cq/5-5/developing/components/edit_config.html#cq:actionConfigs)
    • so on click of button, the attached js function will be invoked where you can write whatever you need to achieve on click of your custom button.
smacdonald2008
Level 10
October 16, 2015

Can you provide a screen shot of exactly where you want to add a button. Typically, you can over-ride any of the AEM components. 

pavel3Author
New Member
October 16, 2015

[img]img.png[/img]

where can I find source code for "edit button" for example? I know about "cq:editConfig" node, but I need exactly source code for this panel.

Sham_HC
Level 10
October 16, 2015

Pavel Kulsha wrote...

where can I find source code for "edit button" for example? I know about "cq:editConfig" node, but I need exactly source code for this panel.

 

/libs/cq/ui/widgets/source/widgets/wcm/EditBar.js