Dynamic template switcher based on user selection |
[eluser]Richard Testani[/eluser]
You can either handle it the way you are suggesting and test for device, or simply use CSS Media Queries: http://css-tricks.com/resolution-specific-stylesheets/ The latter responds to the size of your screen and you can potentially restyle the entire page. If you have a need to load two separate templates, then instead of on or off, maybe: <?php $template = 'desktop'; if($this->agent->is_mobile()){ $template = 'mobile'; } $this->load->view($template, $data); ?> |
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
|