Hi all,

I'm here from http://drupal.org/node/1793534.

We need a "isPortrait" or "isLandscape" within the same device group (mobile / tablet).

I've already leaved a request to the php base library: http://code.google.com/p/php-mobile-detect/wiki/Roadmap

Do you think this will be possible?

Thank you very much!

Comments

fabianx’s picture

Status: Active » Needs work

We discussed this in IRC and here is our approach:

We'll use a JS library for orientation change detection, but start with a simple:

window.addEventListener('orientationchange', handleOrientation, false);

where handleOrientation will set a server side cookie to: FALSE | landscape | portrait

That cookie we will make available in a submodule and allow the page caching like normal:

?type=tablet&orientation=landscacpe

which will then be available in the context as:

"Unknown", "Portrait", "Landscape"

Feel free to trigger a page reload on unknown, but you will need to program this yourself ...

That should solve this issue.

mxt’s picture

Thank you guys for working on this...

mxt’s picture

I don't know, but may be this module http://drupal.org/project/context_resolution can give some inspiration?

mxt’s picture

Any news on this?

Thank you