We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8168
    • 1,118 Posts
    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!
      • 18940
      • 152 Posts
      I dubbs, I can’t help you (yet) but I’m going to use the modx script soon so i’ll let you know what I find.

      Btw, I checked your site JWD on my Samsung Jet but it shows the full site sad

      cheers
        Quality doesn't need a big signature.
        • 26931
        • 2,314 Posts
        I dubbs, I can’t help you (yet) but I’m going to use the modx script soon so i’ll let you know what I find.

        Btw, I checked your site JWD on my Samsung Jet but it shows the full site Sad

        cheers
        there’s also this: http://modxcms.com/extras/package/591
          • 18940
          • 152 Posts
          I also found this, what works for me

          <link rel="stylesheet" type="text/css" href="style/style.css" media="handheld, only screen and (max-device-width: 480px)"> <!-- css for phonebrowser view -->
          <link rel="stylesheet" type="text/css" href="style/style2.css" media="screen, projection"> <!-- css for normal/full view -->

          So I guess no plugin needed, just make multiple css files per device-width? Im not fully sure as I’m still testing this.
            Quality doesn&#39;t need a big signature.