I know it is possible to set a specific theme for several major types of devices, but I think it would also be helpful to do something similar for redirection rules as well.
For instance my main theme is good for most content on mobile devices, with a few exceptions, so most users would be happy using the much nicer regular theme from their more powerful mobile devices. However it would also be nice to be able to access the mobile theme from those devices easily should the need arise. I was thinking a solution along the lines of replicating the same set of controls for picking themes based on device to picking redirection rules as well for situations like this.
So on the Notification/Redirection configuration screen in the Redirection options you can add some additional options, on a per device basis the admin could elect to redirect all mobile traffic, then under iphone/ipod select don't redirect automatically. In this configuration the iphone going to the normal site would not be redirected and get the normal theme, and the more screen friendly mobile theme could be chosen by the user if necessary via a link. This also allows older mobile devices which stand no chance of dealing with the full theme to be automatically redirected still instead of having the user deal with finding the view mobile link somewhere on the site.
Comments
Comment #1
twom commentedHi,
This is a great feature request and should not be to hard to implement. I'll first try to sort out some bugs with user roles, and see what I can do.
However, you are invited to help out and maybe create this functionality. I have already done this for the theme switching. This is basically what you need to do:
and of course you will need to create the user interface in the settings page...
Comment #2
twom commentedComment #3
jacob.myers commentedI am very new to drupal, but if you don't get around to it by this weekend I believe I have some free time I can dedicate to toying around with the code and see if I can't get it at least started in the right direction and figure out the settings UI.
Comment #4
jacob.myers commentedJust messing with this a little bit I decided to take a more simplistic approach for now. I basically decided to just add an override in the redirect area for each device to disable the automatic redirection. Thus if auto redirect is enabled but a device is set to disabled it won't automatically redirect. I accomplished this via the following modifications which I tested briefly, but they seemed to work just fine:
For the UI I simply added the following in mobile_tools_configuration_form():
To power it I added the following to mobile_tools_redirection_boot():
twom - Does this make sense, or is the other approach better? This seemed simple enough and it seemed to do the job.
Comment #5
twom commentedHi,
Looks good from here. I'll add it this week to the code!
Thx,
Tom
Comment #6
minoroffense commented1.x is no longer supported