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

Mobile theme profiles #18

Open sminnee opened 12 years ago

sminnee commented 12 years ago

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

Allow for a ComplexTableField? so people can define which devices should receive a mobile theme. This would mean you can define a number of different themes for different devices.

For example:

Opera mobile, iPhone goes to "mymobiletheme" iPad and Dell Streak go to "mytablettheme"

Any mobile devices that don't belong in a profile would go to full site.

We should also allow an easy way for site developers to set their own mobile devices in the profile checkbox lists, as the default ones won't cover all mobiles by far.

We could also allow for all non-popular mobiles to go to another theme (or an existing one), so there's a fallback for old Nokia phones, for example.

nedmas commented 11 years ago

So for a recent client project I needed to be able to config which devices displayed a mobile site and which didn't. My solution was to switch out the current device detection and replace it with Mobile_Detect (https://github.com/serbanghita/Mobile-Detect) and let the user set which rules to use when checking if a device is a mobile.

I know it doesn't provide everything discussed above, but I was wondering if anyone had any feedback/suggestion as to this being a possible start to solving this issue?

Here's my code so far https://github.com/nedmas/silverstripe-mobile

chillu commented 11 years ago

Note: I've added some rudimentary is_tablet() detection with e4d2600b522bb1259a6a8644adce5297e34b341a and cca20963ba5208a72106ef6e19833b6a6096a410. Its no less hacky than the current detection, but allows for some basic logic switching. In the end, the whole approach of user agent detection is flawed, which I've also noted in the README. Its technically impossible to distinguish a "tablet" running Windows 8 from a "desktop" doing the same thing (or a tablet with a wireless keyboard, sitting on a desk ... you get the point). See http://www.brettjankord.com/2013/01/10/active-development-on-categorizr-has-come-to-an-end/ and http://blog.cloudfour.com/responsive-design-for-apps-part-1/.