Welcome Guest, Not a member yet? Register   Sign In
Dynamic template switcher based on user selection
#1

[eluser]Unknown[/eluser]
Hello guys I just developed 2 templates for my custom CI CMS and I use user agent library to choose template based on device of the visitor like

Code:
$this->load->library('user_agent');
and then to switch template
Code:
if($this->agent->is_mobile()){
   $data['mobile'] = '1';
  } else {
   $data['mobile'] = '0';
  }

So far everything works fine but I want the visitor to switch template ( back and forth ) if he/she is browsing the site on mobile device. I can't wrap my head around this I want to do it like
Code:
< a href="www.mysite.com?template=desktop">Desktop Version</a> or
< a href="www.mysite.com?template=mobile">Mobile Version</a>

Please help!
Thanks!


Messages In This Thread
Dynamic template switcher based on user selection - by El Forum - 03-10-2013, 01:20 PM
Dynamic template switcher based on user selection - by El Forum - 03-10-2013, 02:30 PM
Dynamic template switcher based on user selection - by El Forum - 03-11-2013, 09:33 AM
Dynamic template switcher based on user selection - by El Forum - 03-11-2013, 10:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB