Hi all,
I am really looking for someone to help out me and I am sure lots more the MODx community with a stable, well documented and easy to use Mobile Detection script / pluggin / snippet / chunk. (which ever is best!)
I have used the Mobile Detection Template Switcther listed on the MODx site (
http://modxcms.com/extras/package/557) in the Extras section but cant find any support to extend this and whilst am very happy with it working there are areas where I need some additional support....
Basically I want to be able to add in a button to the "mobile" template that is used that will allow users to revert back to the original template in which each MODx document is created. This way they can opt out of being forced to view the mobile version if they like.
Does anyone know how to do this?
I have found this code on another site and wonder if it might be better?
http://mobiforge.com/developing/story/lightweight-device-detection-php
In essence I would love to be able to:
- Test the users browser
- Set a cookie to mobile=1 (for if they are using a mobile browser), or mobile=0 (if they are viewing via a desktop browser)
- On page load check the value of the ’mobile’ cookie, and server the page with the relevant MODx template (i.e. make no change if mobile=0, and if mobile=1 then render the page using the ’mobile’ template)
- Within the ’mobile’ template I want to have a button which states "click here to view the desktop version of this website" - which when clicked will change the value o
- If the mobile cookie to become mobile=0; reload the page and thus serve up the desktop version....
Is this possible? I know NO PHP at all... but think this kind of extra for MODx would be fab for loads of users!
Please do direct message me to chat through this some more if it does not make sense - It may be possible to amend the current Mobile Detection Template switcher (
http://modxcms.com/extras/package/557) to behave like this but i cant make these amends as i dont know PHP!
Many thanks!