Hi,

I've got theme switching working based on device detection, but cannot seem to get panels to switch to a mobile variant.

I've tried with the different device detection schemes (with and without using wurfl), but always get the desktop panel variant.

Is there something missing?

CommentFileSizeAuthor
#9 php code.PNG17.9 KBAnonymous (not verified)

Comments

minoroffense’s picture

Assigned: Unassigned » minoroffense
Status: Active » Needs work

Currently there's a bug with the context condition form in Panels/CTools with Mobile Tools. I'm working on a patch for the next dev release.

Once I have it ready, I'll post the patch here to test.

minoroffense’s picture

I think this is the same issue #1229944: ctools access plugin doesn't work

Anonymous’s picture

Still isn't fixed :(. Is it still in progress? It paralyzes the development of my website since many of my pages are panels.

minoroffense’s picture

I'm planning a code sprint to work through some issues and get a proper alpha created. Hopefully by the end of April. This issue should be resolved by then. I'll send out a notice when we have the date set.

Thanks for your patience.

Anonymous’s picture

Anyway, thanks for this module; great work! In my opinion part of the future of Drupal.

imoreno’s picture

Hi,
same thing for we, tried to detect device with both mobile tools or Browscap - still, the frontpage panel variant is not detected.

anyway, this module is very cool - it is working on my pruduction travel site and users are very happy with it,
thank you very much minorOffense for a very helpful module !

BR
Itzhak

Anonymous’s picture

You could (temporarily) solve it by adding a PHP filter instead, with filtering on you mobile theme name:

<?php 
/* Access to panel will be granted if current theme is mobile theme */
global $theme_key;
if ($theme_key == 'your_mobile_theme') {
return TRUE;
}
else {
return FALSE;
}
?>

Invert TRUE and FALSE to get the opposite effect (to get access with normal theme).

Note that this will work for the settings you set in mobile tools. If you select a mobile theme for a specific device, this panel will show up for that device.

imoreno’s picture

Thanks joachimroeleveld,
Where would be the best place to locate this peace of code?

BR
Itzhak

Anonymous’s picture

StatusFileSize
new17.9 KB

With panels you can create a selection rule called 'PHP code'. You can do that at the same place where you otherwise would add the mobile tools (called 'Mobile Browser') selection rule (see the attached image).
In the textarea that appears, paste the given PHP snippet (without the php tags!) and give it an administrative title.

Save it, and it should work!

imoreno’s picture

Hi,
Dis exactly what you said and added it to the mobile frontpage selection rule next to my current rule (with only one criteria must pass) yet while there are no errors, the site homepage is still not been redirect to use the roper mobile theme. all other pages are getting the mobile theme, so i guess that this one didn't work for me.
thank you for trying!
any other suggestions?
Itzhak

Anonymous’s picture

You should select 'all criteria must pass'. Also make sure you replaced 'your_mobile_theme' in the snippet with the name of your (mobile) theme.

EDIT: Also, make sure your normal homepage has a selection rule to NOT grant access if the theme is your mobile theme. Just invert TRUE and FALSE in the snippet and add the selection rule in the same way to your normal homepage you did to the mobile homepage.

imoreno’s picture

Thank you so much joachimroeleveld,

Actualy it was working as you say and there was no need to add the negative rule to the homepage panel as in #11, it works out of the box with comments #7 + #9

things one needs to remember in order to make it right:

1. if your site is using panels for homepage override, lets say 'frontpage' - than this parameter needs to be added to the admin/config/system/mobile-tools extra tab, just add 'frontpage' as well

Thank you!

Anonymous’s picture

You're welcome ;).

devin carlson’s picture

Status: Needs work » Closed (won't fix)

The 7.x-2.x branch of Mobile Tools in now unsupported.