Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.


dsheffield
Beginner Modder
ranks
useravatar
User Info

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


Administrator has disabled public posting
metamodguy
useravatar
User Info

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

Administrator has disabled public posting

Board Info

Board Stats:   Total Users: 3107  Total Topics: 1196  Total Polls: 7  Total Posts: 4454  Total Posts Today: 1
User Info:   Newest User :  gobl3t   Members Online: 1   Guests Online: 77
Online 
metamodguy
Topic
New
Locked
Topic
New
Locked
Sticky
Active
New/Active
Sticky
Active
New/Active
New/Closed
New Sticky
Closed/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky Active Locked
Active/Sticky
Sticky/Locked
Sticky/Active/Locked