New features to this module #1

wants to merge 6 commits into


None yet
6 participants

Hi, I did a new website using the mobile module and had to do some modifications which I think would worth sharing with you.

the problems we had was,

  1. we needed four different themes to our site (Desktop version, iPhone Version, iPad version, and Andriod version)
  2. Needed to show / hide pages for different users from different devices (some pages were only visible for desktop users, we didn't want to have any sub domains or sub sites)

I did some modifications to the module which facilitates these, as I think this will be a good addition to the module, just sending a pull request.

thanks for the good work :)


wilr commented Mar 1, 2011

I love the idea of different themes for different browsers ( however don't you think it would be better to abstract away from 3 specific devices (and hard coding) and make that dynamic. Perhaps a dataobject for the profile and have a checkbox for each of the devices in the mobile detection library?

yes, obviously it makes sense, and they can specify any device / theme they need. but logically most sites wont use more than 4 themes? (I can code that up if it you think it helps )

Also I think that access modifier for the devices will be important, cause that was something really helpful with my development.

@fonsekaean fonsekaean MINOR: is_ipad method is more straightforward.
MINOR: is_mobile checks for is_ipad

one more thing, I'd like to add the feature to keep home page for different types of devices, basically mobile users and computer users

if we can integrate the functionality of this module will be more useful.

any updates?


wilr commented Mar 5, 2011

Regarding your last commit you may want to make the fact that an iPad is treated like a mobile theme optional. We have clients who regard the iPad as a full website. The experience on the iPad can be more suited to larger desktop displays.

And like I said in my previous comment, for including this feature in the module I would prefer to have site profiles rather than hardcoded theme for A, theme for B.

Going forward that would be the most sound approach.

I will make it using data objects and commit.

Actually detecting iPad has some more advantages rather than just adding a theme.

  1. IPad too has the mobile safari browser
  2. With it's touch capabilities it might need different javascripts and to manage requirements users can call MobileBrowserDetector::is_iPad()

Also this helped me a lot to make responsive web development possible with Silverstripe

And ipad detection will give the facilitate to have a separate theme for ipad


sminnee commented Mar 9, 2011

It seems like it might be better to break things down so that you can have an arbitrary number of device-specific templates, and then a specification of which devices they apply to.

So, you might configure your themes like this:

  • iOS - theme1
  • tablet - theme2
  • default - theme3

Which would mean iPads and iPhones get theme1, android tablets get theme2, and everything else (including both computers and android phones) get theme3.

However, a more usual grouping might be:

  • smartphone - mobile_theme
  • iPad - tablet_theme
  • default - default_theme

Which means that Android phones and iPhones would get your mobile_theme, iPads (but not android tablets) would get your tablet theme, and everyone else (including android tablets) would get your default theme.

So, what device options would you be able to specify?

  • Platforms: iOS, Android, Windows, OSX, Linux
  • Form factors: mobile, tablet, computer
  • Specific devices: iPad, iPhone
  • Maybe even browsers (this goes beyond mobile): IE, Safari, Chrome, Firefox, Webkit, "Modern"

That last option would enable you to set up an IE lte 6 theme. ;-)

Combined with the theme cascading planned for SilverStripe 3 (where you can have a theme that just defines the differences from the default theme) this could be quite powerful.


wilr commented Mar 9, 2011

sminnee - that was what we were thinking with If you have any other design ideas probably best to post there.

sminnee - I think thats a good option, and my last commit enables theme selection more abstract.

I added some new feature for this, which facilitate the users to show / hide pages from different devices. this will be good to have.

The template selection is taken to a more abstract level now

tadeck commented May 6, 2011

Hello, fonsekaean,

Your commits / pull request and posts contain a typo: andriod should be replaced with android (maintaining upper & lower cases appropriately) in every place this string occurs.

thanks for pointing it out :)

tadeck commented May 9, 2011

No problem. Just there is no need for complaints about the lack of android support ;)


chillu commented Apr 29, 2015

Hey Nivanka, I know this might come as a blast from the past - but if you are interested in still merging this pull request, can you please rebase? Otherwise I'll close it


dhensby commented Jun 14, 2015

@chillu if you think it's ready to go in now, then we can merge by hand to deal with conflicts, however, I think there are valid points being made that haven't been addressed and so someone needs to pick this up if it's going to get in...


chillu commented Jun 14, 2015

Given I haven't heard from Nivanka in over a month, there's merge conflicts, no tests or docs in the PR, on a module which is really an outdated approach to mobile, I'm going to close this.

chillu closed this Jun 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment