Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

iPad Rotation Detection

iPad Rotation Detection

Hi

Is it possible to present a different template using Chameleon when a user rotates his iPad or iPhone etc..

The screen size and shape is different and it would be good to present an optimised layout / template for each screen size.

Darren

dsheffield
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

Re: iPad Rotation Detection

Hi Darren,

I've been reading about some approaches to this recently using CSS "media queries". Chameleon can't directly help you here, though there might be some indirect ways it could help.

Here's the situation:

(1) In order for Chameleon to change the template, there has to be a page refresh. It can only tell the system to use a different template if a page is being requested (that's kinda obvious).

(2) In order for Chameleon to actually know what the new orientation is, it has to be told somehow. This information does not get sent to the server when you do a normal page request, so you'd have to have some JS code on the original page that is continually checking the orientation, and if the orientation changes it does a page refresh to the server including some sort of parameter in the URL (or a POST request) to indicate which orientation is required.

(3) You have a classic "first page problem" in that there's no way for the server to know which orientation to use for the first page that is requested. One way around that if you detect an iPad for the 1st pageview, you serve up only a tiny JS page that detects the orientation and redirects to a URL that indicates that orientation. Then the rest goes from there.

Chameleon can obviously help in all of this because it could be the mechanism that detects the different incoming URLs and changes the template accordingly.

However, the JS code is the part that I don't have. Are you a JS expert? Could you put something together for that?

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10783
Newest User:
weatti4qx
Members Online:
0
Guests Online:
269

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked