Full version of mobile site
Permalink
I followed the directions by Andrew to set up a mobile theme:
http://www.concrete5.org/help/building_with_concrete5/developers/th...
which worked wonderfully - I just had one additional question. With the way Andrew describes setting up the theme switcher - does that leave any possible way to give the visitor the option to switch to the "full" version of the site if they so choose, rather than being permanently stuck in the mobile theme?
http://www.concrete5.org/help/building_with_concrete5/developers/th...
which worked wonderfully - I just had one additional question. With the way Andrew describes setting up the theme switcher - does that leave any possible way to give the visitor the option to switch to the "full" version of the site if they so choose, rather than being permanently stuck in the mobile theme?
If you modify the c5touch theme a little it will work/look exactly the same on a blackberry as it does on an iphone. I will have an example shortly that you can review.
Sweet! Thank you very much, .css and I don't get along very well :) LOL
replace with this won't display c5touch differently on a a blackberry, but it will display c5touch. if you want to display it differently on a blackberry, create an alternate verion of c5touch, like c5touch1. then use this code.
as for displaying the desktop version, basically you would need a button that would force the blackberry to fake its user agent, which i don't think is possible.
class ThemeSwitcher { public function checkForIphone($view) { if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') > -1) { $iphone = PageTheme::getByHandle('c5touch'); $view->setTheme($iphone); } } }
<? class ThemeSwitcher { public function checkForIphone($view) { if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'Android') || strstr($_SERVER['HTTP_USER_AGENT'], 'Blackberry') || strstr($_SERVER['HTTP_USER_AGENT'], 'OperaMobi') || strstr($_SERVER['HTTP_USER_AGENT'], 'IEMobile') || strstr($_SERVER['HTTP_USER_AGENT'], 'webOS')) { $iphone = PageTheme::getByHandle('c5touch'); $view->setTheme($iphone); } } }
class ThemeSwitcher { public function checkForIphone($view) { if (strpos($_SERVER['HTTP_USER_AGENT'], 'Blackberry') > -1) { $iphone = PageTheme::getByHandle('c5touch1'); $view->setTheme($iphone); } } }
as for displaying the desktop version, basically you would need a button that would force the blackberry to fake its user agent, which i don't think is possible.
Wouldn't it be possible to set a cookie if the user opts for the full version, then have the theme switcher check for the cookie first, then revert to user agent?
Yeah maybe but I don't know how you'd make something like that though
I'm hoping c5 comes out with a mobile default theme like plain yogurt. everyone needs it. I think it would help c5 out getting people converted over to c5.
Yeah that would be good, I have mobile theme in submission but preloaded would be sick. I'd use maybe 2-3 more default theme
tell me if you come out with anything that would work, Im building a mobile them and that would be a great feature for it.
I wish their was a Blackberry compatible mobile theme that I could use this with :)