Exclude Mobile theme from iPads
Permalink 2 users found helpful
When applying a mobile theme in the dashboard it seems to change it for tablets as well as mobile.
I have seen a few posts about this, and there seemed to be a fix for previous versions of Concrete5 (up to 5.6.1 i think) but this doesn't work for the latest version. (http://www.concrete5.org/community/forums/usage/mobile-theme-switcher-ipad/)
You can go into libraries/3rdparty/mobile_detect.php and exclude tablets and this then seems to work ok (tested on a kindle fire), BUT.. on the iPad it still display's the mobile theme?
I did try commenting out any reference to iPad in the mobile_detect.php file but this still had no effect?
Does anyone have a definitive answer to getting the mobile theme to exclude ipads, without having to revert to redirecting to a different site.
It seems like there are a few people out there without responsive sites, or people that want to display a cut down version of their sites, but need it to show the desktop version on ipads and tablets.
Any help anyone can give would be much appreciated.
I have seen a few posts about this, and there seemed to be a fix for previous versions of Concrete5 (up to 5.6.1 i think) but this doesn't work for the latest version. (http://www.concrete5.org/community/forums/usage/mobile-theme-switcher-ipad/)
You can go into libraries/3rdparty/mobile_detect.php and exclude tablets
// $this->tabletDevices,
I did try commenting out any reference to iPad in the mobile_detect.php file but this still had no effect?
Does anyone have a definitive answer to getting the mobile theme to exclude ipads, without having to revert to redirecting to a different site.
It seems like there are a few people out there without responsive sites, or people that want to display a cut down version of their sites, but need it to show the desktop version on ipads and tablets.
Any help anyone can give would be much appreciated.
Thanks for your reply. Your right it has been a frustrating problem.
I have managed to do something similar to what your suggesting, I just hadn't got around to posting my findings.
What I did was comment out some lines like you have, as follows:
lines 396 & 417
line 212
line 187
This seemed to work for me, but like you can't test it over multiple devices but seems OK on iPads, Kindles, and HTC.
Unfortunately, this doesn't resolve the issue of it displaying the wrong theme if full page caching is switched on. Don't know if there is a way of forcing it to load the page (not the cached version) if visiting from a mobile device?
I have managed to do something similar to what your suggesting, I just hadn't got around to posting my findings.
What I did was comment out some lines like you have, as follows:
lines 396 & 417
//$this->tabletDevices,
line 212
//'Safari' => 'Version.*Mobile.*Safari|Safari.*Mobile',
line 187
// 'iOS' => '\biPhone.*Mobile|\biPod|\biPad',
This seemed to work for me, but like you can't test it over multiple devices but seems OK on iPads, Kindles, and HTC.
Unfortunately, this doesn't resolve the issue of it displaying the wrong theme if full page caching is switched on. Don't know if there is a way of forcing it to load the page (not the cached version) if visiting from a mobile device?
In concrete/core/libraries/view.php
line 574 (in checkMobileView function )
change: if ($md->isMobile())
to: if ($md->isMobile() && !$md->isTablet())
line 574 (in checkMobileView function )
change: if ($md->isMobile())
to: if ($md->isMobile() && !$md->isTablet())
Just had a breakthrough, but not sure if it 100% working (do not have all all the devices to test).
in mobile_detect.php
From line 392 change this :
I have galaxy s3 which is showing the mobile website and galaxy tab 3 which is showing the desktop version. would be cool to know if it is working on apple devices.
Again, not sure if this 100% full proof.
*EDIT* just to note this is for conc5 5.6.2.1
-Garen