AEM CQ 56 - Extending SiteAdmin to show Search tab on login

Goal


When a user logs into siteadmin console http://localhost:4502/siteadmin, the Websites tab is shown. Here we need Search tab to be shown by default and not Websites

Solution


1) Login to CRXDE Lite, create folder (nt:folder) /apps/showsearchtab

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

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

                         showsearchtab.js

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

(function(){
       var INTERVAL = setInterval(function(){
                var comp = CQ.Ext.getCmp("cq-siteadmin-tabpanel");

                if(comp){
                    clearInterval(INTERVAL);
                    comp.setActiveTab(1);
                }
        }, 250);
})();

No comments:

Post a Comment