Hi-

I'm requiring my site to use theme switching based on device detection. Site looks great on the laptop, but I've created a mobile theme for the iPhone and iPad. When I choose a theme for the iPhone, it changes to whatever I select. The iPad continues to display the main theme even when the filter is enabled and the mobile theme is selected.

Comments

Chris Vanderwall’s picture

bump

mikebann’s picture

Try turning cache off. Especially if you are not redirecting different devices to different url's. I think this module has to be revamped to recognize how drupal cache's things.

Chris Vanderwall’s picture

Unfortunately, that was already the case. I'm working on a development site, so already had the cache turned off. Any other ideas?

joshberry’s picture

Ok, so on line 497 of mobile_tools.module, the iPad case is treating the browser as a desktop browser:

      $mobile_browser = array('type' => 'desktop', 'group' => 'ipad');

Change 'desktop' to 'mobile' and you should be all set:

      $mobile_browser = array('type' => 'mobile', 'group' => 'ipad');
twom’s picture

Assigned: Unassigned » twom
Category: bug » support

Hi,

By design Mobile Tools treats iPads as desktop devices. It is really a matter of preference for your specific project what determines what you need.

The best solution is to write your own custom device detection plugin to Mobile Tools where you do whatever you want:

http://mobiledrupal.com/content/create-your-own-device-detection-algorit...

Gastonia’s picture

I'm having this problem as well.

But, the problem is related to the new iPad software update that happened just a couple weeks ago to 4.3. After this update, the os and browser agent strings changed, and mobile tools is no longer correctly recognizing the device.

True that mobile tools by design treats iPad as a Desktop version. But this isn't the case if you select the filter for iPad and manually assign it another theme.

Mine was working perfectly, and then suddenly it broke right after the update.

So, in other words, as soon as mobile tools is updated to correctly detect iPad as of 4.3, it should work fine after that.

bkosborne’s picture

Hmmm hopefully this gets fixed. I'll try and get a patch up if I have time.

devin carlson’s picture

Status: Active » Closed (duplicate)