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!
      • 8168
      • 1,118 Posts
      AMDBuilder Seemed to request a very similar thing here - http://modxcms.com/forums/index.php/topic,34858.0.html

      Has anyone got this solution working?

      Rather than a hard re-direct to a different ’mobile’ page - I am interested in the same pages within my site being availble but decorated in a ’mobile’ specific page template


      Could anyone adapt the code here - http://modxcms.com/forums/index.php/topic,34858.0.html to work as i have outlined above?

      would love to hear from you if you could!
        • 8168
        • 1,118 Posts
        Does anyone know if this might be possible? Am desperate to get this working!


        Many thanks!
          • 1343 ☆ A M B ☆
          • 2,213 Posts
            Patrick | Server Wrangler
            About Me: Website | Tweets |  MODX Hosting
            • 8168
            • 1,118 Posts
            Thanks AMD Builder - Yep I am using that already - what I need is some way to modify this to allow me to set a session variable to either switch all pages to the "mobile" template or keep the pages in their current templates...

            Any ideas on how to modify this?
              • 8168
              • 1,118 Posts
              The default mobile template switcher switches you to a ’mobile’ template when it recognises you are viewing on a mobile device - I would like to be able to add in a button to over-ride this function if the user so chooses.

              E.g. If they are forced to view the mobile version because the detection reads they are a mobile device, but want to view the full version - I would like to be able to allow the user to do this...


              Any ideas on how to do this?

              According to the instructions on the Add on - it says that i works by setting a cookie - I cant work out what this cookie is called and how to override it and reset from a button on the mobile template....



              If anyone could help solve this I would be very greatfull!


              Many thanks
                • 12680
                • 1 Posts
                Hi,
                there is another solutions, is called "Apache Mobile Filter".
                The module detects the mobile device and passes the WURFL capabilities on to the other web application as environment variables. It can also be used to resize images on the fly to adapt to the screen size of the mobile device.

                For more info: http://www.idelfuschini.it/it/apache-mobile-filter-v2x.html
                  • 8168
                  • 1,118 Posts
                  Hi ifuschini,

                  Do you know how to use this? I am not a programmer but would love to have it working in my site!
                    • 22897 ☆ A M B ☆
                    • 209 Posts
                    dubbs, did you get this sorted?
                      MAPLEDESIGN MODX development and MODX web design and custom development. Proud to serve UK and International clients!
                      • 8168
                      • 1,118 Posts
                      Quote from: pbowyer at Oct 12, 2009, 04:04 AM

                      dubbs, did you get this sorted?

                      Thanks Yep I did I commissioned Everett to build out a bespoke pluing for me, I believe its now available to all here - http://modxcms.com/extras/package/591