silverstripe-archive / silverstripe-mobile

Mobile support module for SilverStripe CMS
http://silverstripe.org/mobile/
BSD 3-Clause "New" or "Revised" License
35 stars 36 forks source link

Ipad detection #13

Closed sminnee closed 12 years ago

sminnee commented 12 years ago

From http://open.silverstripe.org/ticket/5998

Currently there's no ipad detection, which considering it's quite a different size device would be good to have

        public static function is_ipad() {
            return (preg_match('/(ipad)/i', $_SERVER['HTTP_USER_AGENT'])) ? true : false;
        }
        switch(true) {
            case(self::is_iphone()):
                $isMobile = true;
                break;
            case(self::is_ipad()):
                $isMobile = true;
                break;
sminnee commented 12 years ago

Detecting iPad is a good idea, but it's not always considered a "mobile" (as in iPhone or similar profile device). Some sites like Last.fm still use their full site template for iPads, for example. Others have a specific template for the iPad alone.

We could allow an additional behaviour for tablet based devices like the iPad. This could be as simple as a dropdown in the "Mobile" tab inside the CMS which allows the following different behaviour:

Use full site theme Use mobile site theme Use tablet theme