내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Hiding Deactivate Page in sidekick

Avatar

Level 2

Hi All,

Can you please help how to hide Deactivate Page option from Side kick? I could able to do it from Site admin but could not able to get rid of this.

Thanks,

Phani

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Administrator

phanirajkumarb74317693 wrote...

Hello Kautik, also how the javascript gets invoked in the above provided code? Do we need to call it from any component or?

 

Hi 

You will notice that the client library has category of “cq.widgets”. Using this category means its loaded with all of CQ’s standard widgets. No extra includes needed in the component!!

Reference article :- http://www.adamcancode.com/adobe-cqaem-custom-widgets/

~kautuk



Kautuk Sahni

원본 게시물의 솔루션 보기

6 답변 개

Avatar

Administrator

Please have a look at this community article:-

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

1) Code a servlet apps.experienceaem.sidekick.GetUserGroups to return the logged-in user groups.

2) Login to CRXDE Lite, create folder (nt:folder) /apps/skdisable

3) Create clientlib (type cq:ClientLibraryFolder) /apps/skdisable/clientlib and set a property categories of String type to cq.widgets

4) Create file ( type nt:file ) /apps/skdisable/clientlib/js.txt, add the following

                         disable.js

5) Create file ( type nt:file ) /apps/skdisable/clientlib/disable.js, add the following code

    (function(){
        if( ( window.location.pathname == "/cf" ) || ( window.location.pathname.indexOf("/content") == 0)){
            var SK_INTERVAL = setInterval(function(){
                var sk = CQ.WCM.getSidekick();
 
                if(sk && sk.panels){
                    clearInterval(SK_INTERVAL);
 
                    $.ajax({
                        url: '/bin/experienceaem/getgroups',
                        dataType: "json",
                        type: 'GET',
                        async: false,
                        success: function(data){
                            data = data[CQ.User.getCurrentUser().getUserID()];
 
                           if(data.indexOf("administrators") !== -1){
                                return;
                            }
                            var pagePanel = sk.panels["PAGE"];
 
                            var buttons = pagePanel.findBy(function(comp){
                                return comp["name"] == "PUBLISH" || comp["name"] == "DEACTIVATE";
                            }, pagePanel);
 
                            CQ.Ext.each(buttons, function(button){
                                button.setDisabled(true);
                            });
                        }
                    });
                }
            }, 250);
        }
    })();

~kautuk 



Kautuk Sahni

Avatar

Administrator

you can skip point 1 also, but then you can do it like.

// 

 if(CQ.User.getCurrentUser().hasPermissionOn("replicate", [CQ.WCM.getSidekick().getPath()])!=true){

            if(sk && sk.panels){
                clearInterval(SK_INTERVAL);


                        var pagePanel = sk.panels["PAGE"];

                        var buttons = pagePanel.findBy(function(comp){
                            return comp["name"] == "PUBLISH" || comp["name"] == "DEACTIVATE";
                        }, pagePanel);

                        CQ.Ext.each(buttons, function(button){
                            button.setDisabled(true);
                        });

                }



Kautuk Sahni

Avatar

Level 2

Thank you Kautuk,

Can't we hide it from Useradmin like a particular usergroup can't see this option(Deactivate Page)? This option was not there in CQ 5.5 but is seen in 6.2

Avatar

Administrator

phanirajkumarb74317693 wrote...

Thank you Kautuk,

Can't we hide it from Useradmin like a particular usergroup can't see this option(Deactivate Page)? This option was not there in CQ 5.5 but is seen in 6.2

 

I am not sure about it.

Let me ask this with internal people and then get back to you.

~kautuk



Kautuk Sahni

Avatar

Level 2

Hello Kautik, also how the javascript gets invoked in the above provided code? Do we need to call it from any component or?

Avatar

정확한 답변 작성자:
Administrator

phanirajkumarb74317693 wrote...

Hello Kautik, also how the javascript gets invoked in the above provided code? Do we need to call it from any component or?

 

Hi 

You will notice that the client library has category of “cq.widgets”. Using this category means its loaded with all of CQ’s standard widgets. No extra includes needed in the component!!

Reference article :- http://www.adamcancode.com/adobe-cqaem-custom-widgets/

~kautuk



Kautuk Sahni