Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » iPad Rotation Detection
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
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
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » iPad Rotation Detection
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7630
- Newest User:
- welch84998
- Members Online:
- 0
- Guests Online:
- 102
- 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