Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

sidekick overide Activate Page method

Avatar

Level 4

Hi All,

I am using 5.6.1 AEM.. and needed to override  â€œActivate page”  method  when user click in sidekick. I am able to overlay Activate behavior for WCM and DAM. But not able to do Activate page for “sidekick”

Here is the JS /libs/cq/ui/widgets/source/widgets/wcm/Sidekick.js

And here is the method  which I want to override in my apps.

/**

     * Returns the config for the default Publish button.

     * @private

     * @param {Object} currentPage The current page

     * @return {Object} The config for the default Publish button

     */

    getPublishConfig: function(currentPage) {

        currentPage = currentPage || CQ.WCM.getPage(this.path);

        return {

            "text": this.publishText,

            "hidden": currentPage.isLaunch(),

            "handler": function() {

                var sidekick = CQ.wcm.Sidekick.findSidekick(this);

                var data = {

                    id: CQ.Util.createId("cq-asset-reference-search-dialog"),

                    path: [sidekick.getPath()],

                    callback: function(p) {

                        CQ.wcm.SiteAdmin.internalActivatePage(p, function(options, success, response) {

                            if (success) {

                                CQ.Notification.notify(sidekick.publishText,

                                        CQ.I18n.getMessage("Page successfully  2 activated"));

                            } else {

                                CQ.Notification.notifyFromResponse(response);

                            }

                        });

                    }

                };

                new CQ.wcm.AssetReferenceSearchDialog(data);

            },

            "context": [

                CQ.wcm.Sidekick.PAGE

            ]

        };

    },

 

 

There are couple of articles how to override the sidekick but those are new button and or new Tab… I don’t want to ads new button or action. I just want to override the “activate page” function/method that’s it.

 

http://experience-aem.blogspot.com/2014/03/disable-sidekick-activate-deactivate.html

http://adobeaemclub.com/customize-aem-sidekick-add-useful-feature/

https://forums.adobe.com/message/4893964#4893964

 

Any thoughts or advice?.

 

Regards,

Chandra

1 Reply