Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.



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


iPad Rotation Detection

iPad Rotation Detection


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.


Beginner Modder
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 Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

3330 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
Total Topics:
Total Polls:
Total Posts:
Posts this week:
User Info:
Total Users:
Newest User:
Members Online:
Guests Online:

There are no members online

Forum Legend:

 New Sticky