Expand my Community achievements bar.

SOLVED

Edit bar

Avatar

Level 1

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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.

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

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.

Avatar

Level 10

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. 

Avatar

Level 1

[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.

Avatar

Level 10

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