We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25357
    • 92 Posts
    I've just discovered and am playing with this plugin, and so far only have two issues with it (It seems to work OK . . . ) I can't locate any documentation for it or the author's site. So hopefully one of the other 500 or so developers that have downloaded it can assist. smiley

    1. The recommended override appears to have no effect:

    site.com/page?browser=mobile

    Stays on the <standard> version (though the mobile version hides fine, and vice-versa). I also can't see any cookie being set in FF Cookies (though it may be a session cookie and not show up there?)

    2. Most likely the Achilles Heel of #1 above, a client wants a "view main site" link on the mobile version which I'm pretty sure will cause the whole house of cards to come down. I can try setting a cookie and force a series of overrides to "browser=standard" but if it's not working above, it won't work here . . .

    So the expected effect will be mobile -> click link -> detect mobile and back to mobile . . .

    Has anyone worked with this plugin and got any ideas how I can pull this off? Overall the plugin will work nicely except the switching part. [ed. note: rocknbil last edited this post 15 years ago.]
      • 32316
      • 387 Posts
      whistlemaker Reply #2, 15 years ago
      Thanks for bringing this to my attention - I checked out this extra and found these links to force a choice worked for me:

      test-page.html?browser=full
      test-page.html?browser=mobi

      from the readme.txt ... here .... core/components/mobiledetect/readme.txt
      which I admit is a little confusing.
      [ed. note: whistlemaker last edited this post 15 years ago.]
        • 25357
        • 92 Posts
        Ah . . thank you . . . the distro and notes in the install say mobile. smiley Have any thoughts about a "full site" link?
          • 32316
          • 387 Posts
          whistlemaker Reply #4, 15 years ago
          page.html?browser=full is the link that shows the 'standard site'
            • 25357
            • 92 Posts
            Right, but I'd have to devise some way of "carrying" that query string throughout the pages - or are there internal mechanisms that manage that? I'll give it a shot.
              • 33983 ☆ A M B ☆
              • 181 Posts
              I have refactored and enhanced the code for modMobile extra (similar to mobile detection) which saves a cookie to remember if full or mobile. Here is the code: https://github.com/jgulledge19/modMobile.
                • 3232
                • 380 Posts
                I don't think you would have to carry the string from each URL. You would just need to see what the cookie is set at, if the cookie is set to full, then display the full site even if it is on a mobile device.

                Then if ?browser=detect is applied, the cookie would reset and show the mobile site.

                Right now it doesn't look like this variable sticks. If I visit my site on mobile and pass variable ?browser=full when I click on a link, the site is back to mobile. Shouldn't this stick because of the cookie?
                  • 36446
                  • 184 Posts
                  Right now it doesn't look like this variable sticks. If I visit my site on mobile and pass variable ?browser=full when I click on a link, the site is back to mobile. Shouldn't this stick because of the cookie?

                  I have the same issue. Would be great if someone could tell us how this could be handeled smiley
                    https://www.beautyislife-shop.de - premium make-up!
                    https://www.topsterne.de - sell it here!
                    ---------------------------------------------------------
                    • 36446
                    • 184 Posts
                    figured it out - need to set this to no to keep the user setting:
                    function clear_user_prefs() {
                    	if ($usecookie == 'no') {
                    		setcookie('browser','',time()-3600, "/", "", 0);
                    	}


                    great! no i have what i got smiley
                      https://www.beautyislife-shop.de - premium make-up!
                      https://www.topsterne.de - sell it here!
                      ---------------------------------------------------------
                      • 11838 ☆ A M B ☆
                      • 79 Posts
                      Hello,

                      i'm trying to get Mobile detection working but il only shows <standard></standard> code. My ressource is uncached and I clear the cache many times. I' ve tried with "mobile or standard" template and chunks, and with "one page to rule them all" <mobile></mobile<standard></standard>. But it only shows standard in each case. I'm a bit frustrated, someone could help ?

                      myurl.com/index.php?browser=mobi works

                      i am using this kind of simulator : testiphone.com

                      I've tried modmobile too but there is an error while intalling the package. Maybe someone knows an easier way to do that ? Mobile detection seems to be the solution, i'd really like this to work.

                      Thank you !!

                      Modx revo 2.2 , MySQL 5.1, windows 7 firefox