Expand my Community achievements bar.

SOLVED

Disable Sidekick for mobile devices(or specific user).

Avatar

Former Community Member

Hi All,

I just wanted to check if I can disable sidekick and stop cq5 related JS from loading for mobile devices or specific users as we are not planning to edit content on a mobile anyway.

The problem is that it slows down page loading a lot and we cannot really test our custom JS like that.

Im sure there must be a very simple solution for that but I cannot seem to find it....

Cheers

Kostya

1 Accepted Solution

Avatar

Correct answer by
Level 7

The script in which the sidekick loads is the "/libs/wcm/core/components/init/init.jsp" Since you probably include this script everywhere, as one usually does, you will have the sidekick on all the pages. You could then, depending on the setup of your site, choose to overlay this init script and make the necessary modifications to it to hide it in the mobile view ? Just beware of the other things that might be in that script so you don't remove anything vital for CQ to work properly.
 
Good luck
/Johan

View solution in original post

3 Replies

Avatar

Correct answer by
Level 7

The script in which the sidekick loads is the "/libs/wcm/core/components/init/init.jsp" Since you probably include this script everywhere, as one usually does, you will have the sidekick on all the pages. You could then, depending on the setup of your site, choose to overlay this init script and make the necessary modifications to it to hide it in the mobile view ? Just beware of the other things that might be in that script so you don't remove anything vital for CQ to work properly.
 
Good luck
/Johan

Avatar

Level 1

Take a look to the channel property of the clientlibs http://dev.day.com/docs/en/cq/current/developing/components/clientlibs.html. There you can exclude mobile groups e.g. with the !touch property. You have to set this property to the cq.wcm.edit clientlib folder under /libs/wcm/core/clientlibs/edit. But as Ojjis mentioned you have to customize the init.jsp because there the Sidekick is direct called. Add a condition e.g. if(CQ.WCM.launchSidekick)...

Regards
Burkhard