Different templates fo mobile phones and tablets

Post Reply
Ramp
Posts: 135
Joined: Sun Jun 09, 2013 11:23 am

Different templates fo mobile phones and tablets

Post by Ramp »

Hi,
Is it possible to show 1 template for mobile phones and another for tablets?
admin
Site Admin
Posts: 38004
Joined: Wed Sep 10, 2008 11:43 am

Re: Different templates fo mobile phones and tablets

Post by admin »

Don't forget to run script update
Ramp
Posts: 135
Joined: Sun Jun 09, 2013 11:23 am

Re: Different templates fo mobile phones and tablets

Post by Ramp »

if (list of mobile browsers ) {



what to type instead of that "list of mobile browsers"


how would it look like?


for example: iphone and ipad use the same browser.
admin
Site Admin
Posts: 38004
Joined: Wed Sep 10, 2008 11:43 am

Re: Different templates fo mobile phones and tablets

Post by admin »

Did you read whole doc ?
mobile_index ?
Don't forget to run script update
Ramp
Posts: 135
Joined: Sun Jun 09, 2013 11:23 am

Re: Different templates fo mobile phones and tablets

Post by Ramp »

I think you don't understand my question.


Imagine I have 3 different users on my website.
1. comes from computer
2. comes from ipad
3. comes from iphone


I want to show a computer site version for computer user, then I want to show ipad(or tablet) version for tablet user and iphone(mobile) version for iphone.

How do I make that?
admin
Site Admin
Posts: 38004
Joined: Wed Sep 10, 2008 11:43 am

Re: Different templates fo mobile phones and tablets

Post by admin »

ok, create 3 templates


then in common.php add

if (it's a computer) $_GET['force_template'] = '...';
if (it's a tablet) $_GET['force_template'] = '...';
if (it's a mobile) $_GET['force_template'] = '...';

I hope this idea is pretty simple.
Don't forget to run script update
Post Reply