ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Mobile Site Best Practices

August 12, 2010 11:22am

Subscribe [8]
  • #1 / Aug 12, 2010 11:22am

    Jeremy Bise

    77 posts

    So let’s say we have a wonderful, shiny ExpressionEngine powered website up and running and you want to create a mobile-optimized site…jqTouch, optimized CSS, or however else.

    What’s the best practice for a) detecting the mobile device so as to “go” to the mobile version, and b) letting the visitor choose to view the full site if they want?

  • #2 / Aug 30, 2010 10:38pm

    Angie Herrera

    365 posts

    Progressive Enhancement. 😊 Take a look at enhance.js: http://www.filamentgroup.com/lab/introducing_enhancejs_smarter_safer_apply_progressive_enhancement/  Simple and really well done. Recently used it and works great.

  • #3 / Aug 31, 2010 10:09am

    hd 

    156 posts

    Another method:

    You can use a snippet of PHP (with get_browser) to do the mobile browser detection, then forward those users to a different template folder which uses jQTouch or Sencha (or the upcoming jQMobile).

    The only problem we have with enhance.js for this purpose is that some mobile browsers (like the iPhone) will still pass the tests, when we still want to display a mobile-optimized version of the site for them with Sencha. Also, directing the user without javascript should be faster.

  • #4 / Sep 03, 2010 1:45am

    Greg Aker

    6022 posts

    I’d recommend against get_browser(), as it relies on browscap.ini.  Unless you control your production environment, you can’t always guarantee it will be installed.  If you’re on EE2, you can use the CodeIgniter User Agent class, as we do something similar in the control panel to detect the UA.

    -greg

  • #5 / Sep 06, 2010 6:01pm

    codeM

    51 posts

    Agree with Greg here, using the User Agent class from CI makes more sense and more reliable. Tried also fooling around with Sencha but am waiting out a month or two before deciding which mobile framework to use, see who is coming out ahead 😊

  • #6 / Dec 10, 2010 7:13pm

    jtoast

    32 posts

    I just came across Andy Moore’s solution at http://detectmobilebrowsers.mobi/. Seems easy enough. Will report back.

  • #7 / Dec 14, 2010 4:40am

  • #8 / Jul 18, 2011 2:45pm

    rbboyl

    38 posts

    I’m looking at MX mobile detect as well.  I do have a question that I hope the community can shed some light on.

    Let’s say I use MX mobile detect and it detects an iOS or Android browser and redirects them over to the mobile version of the site.  I want to put a link to give the user the option to “View the Full website”.  How do I override the mobile browser detect?

  • #9 / Jan 23, 2012 11:18am

    carvingCode

    380 posts

    I’m curious how you all are handling redirection to a separate template group for mobile devices using MX Mobile Detect?

    There is no problem if redirecting to a ‘http://domain.com/mobile’ based set of templates.  But how would you set up a redirect to ‘http:/m.domain.com’?  Probably some .htaccess magic, but what?

    TIA

    Randy

  • #10 / Jan 23, 2012 12:19pm

    rbboyl

    38 posts

    You would either set a subdomain redirect in your domain settings or use .htaccess.  I chose to use the former method.

  • #11 / Jan 23, 2012 1:25pm

    carvingCode

    380 posts

    Thanks.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases