Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Mobile template

Quote Reply
Mobile template
Hi Andy... folks.

Does anyone have some experience about setting or creating a template to have a mobile version of my directory?

I still dont know if I'll use a .mobi domain or if I'll just have a m.subdomain on my website

Thanks for letting me know or for pointing me to the right direction.

Jesus
Quote Reply
Re: [Jesus] Mobile template In reply to
Hi,

The main thing to take into consideration with that, is to setup a new template set specifically for mobiles. Then, if using static pages - try the GT MultiLanguage plugin to build your directory at a new location specifically for mobiles. Then you can then point your visitors to that part of your site if they are using a mobile.

It can be done more elegantly (i.e detecting if they are using a mobile, and automatically re-directing them), but that can get quite complicated Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Mobile template In reply to
Hi Andy,

Thanks for your answer.

I got covered the auto-detection JS code, so if a user came to my website using a mobile device I'll be able to mov it to the proper directory if need it.

I need more details about getting done a template specifically for my mobile device users. Do you know or have a demo to see how that works?

Thanks as always for your help!

Jesus
Quote Reply
Re: [Jesus] Mobile template In reply to
mmm I just checked and $500 US for the GT Multilanguage plugin seems expensive and I really need to give my users a chance to do searches and browse categories from mobile devices.

Any other solution I can work with?
Quote Reply
Re: [Jesus] Mobile template In reply to
Hi,

If you are using mod_rewrite to serve your pages (instead of physical .html pages), then you could maybe make a tweak in page.cgi / search.cgi etc so that it checks to see if they are using a mobile device, and then uses a different template set. This blog post of mine may help you here:

http://www.mywebsitedesignersblog.com/...ing-a-mobile-device/

Hope that helps

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Mobile template In reply to
Thanks Andy, I'm checking your post. WIll get back to you if I've any questions.

Jesus
Quote Reply
Re: [Jesus] Mobile template In reply to
Looks interesting the code you wrote.

However I think that part its the one I've covered, as I've a JS that actually detects if I'm using a Mobile device.

Now, I've my template ready to mobile devices, so I've:

1 template for regular websites and another template to build my static mobile device template.

As I'm using static pages, I was thinking to move my setup options to be able to build 2 separate templates (regular and mobile) or if you know any other solution (besides the plugin you mention) that its kind of expensive for me.

I think I understand what that plugin do but I'm not thinking to have different langs for my directory, just to be able to build a simpler template for mobile devices.

What do you think? Is there something we can use for this?

Jesus
Quote Reply
Re: [Jesus] Mobile template In reply to
Hi,

The problem with Javascript, is that it has to load the page first - to run the code. So what you are in fact doing, is loading the NORMAL page first, and then re-directing to the new mobile version.... so that would be pretty slow. If you are using "real" static files, then it may be worth looking at some rewrite rules in a .htaccess file to do the magic:

http://ohryan.ca/...te-rules-simplified/

So something like:

Code:
RewriteEngine On

# if the browser accepts these mime-types, it's definitely mobile, or pretending to be
RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC,OR]
# a bunch of user agent tests
RewriteCond %{HTTP_USER_AGENT} "sony|symbian|nokia|samsung|mobile|windows ce|epoc|opera" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "mini|nitro|j2me|midp-|cldc-|netfront|mot|up\.browser|up\.link|audiovox"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "blackberry|ericsson,|panasonic|philips|sanyo|sharp|sie-"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "portalmmm|blazer|avantgo|danger|palm|series60|palmsource|pocketpc"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "smartphone|rover|ipaq|au-mic,|alcatel|ericy|vodafone\/|wap1\.|wap2\.|iPhone|android"[NC]
RewriteRule ^(.*)$ http://m.yoursite.com/$1 [R=302,L]

Then setup that sub-domain on your site, and create the following extra mod_rewrite rules in that new sub-domain:

Code:
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !\.(jpg|gif|js|css|xml|png|php|cgi|pl|JPG|GIF|BMP|flv|swf|xml)$
RewriteRule ^(.*).html /full/path/to/live/site/cgi-bin/page.cgi?g=$1.html;t=mobile [L]

RewriteCond %{REQUEST_FILENAME} !\.(jpg|gif|js|css|xml|png|php|cgi|pl|JPG|GIF|BMP|flv|swf|xml)$
RewriteRule ^(.*).cgi /cgi-bin/$1.cgi?$1;t=mobile [L]

Totally untested, but hopefully it will get you on the right track. I can't really offer much more help, apart from doing it as a paid job Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Jesus] Mobile template In reply to
Hi,

I'm not sure if you're interested - but I've had several people asking me about a plugin to make a different template set work for mobile users. I've got the start of it running now (its a new template set, but nothing like luna - much simpler, and quicker to load). Obviously you could still use the luna template set if you wanted (and rename it luna_mobile or something), but in terms of speed for your users - you really wanna make it as simple as possible.

Anyway, I'll post something more about this when I get a bit more done and have something to show. I expect its gonna be around the $100 mark (or $150 if you need it setup, and obviously more if you need template customiztions above what is included)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Mobile template In reply to
This seems like a great idea.

I can help you beta test and if you want/need I do have some mobile templates we can use for this project. My templates are fast and easy to load for mobile devices.

Let me know if there's something I can help you with.

Jesus
Quote Reply
Re: [Jesus] Mobile template In reply to
Hi,

Thanks, that would be helpful (at the moment I've been "trimming" down one of my own template sets, but even that may seem a little "bloated" for some mobile users). Once I've got it all working tomorrow, I'll send you a copy of the plugin to have a test with (obviously it will need setting up on a new install, before ready to go on your live site :))

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Mobile template In reply to
I'll be able to test it tomorrow just for half or the day.

I'm leaving and will be just on mobile device until next Sunday. I'll get back at work normally next Monday, but I can sure help you with mobile test during my absence from work.

Also, will try to send you my template by email as well.

Jesus
Quote Reply
Re: [Jesus] Mobile template In reply to
Hi,

You can now see the demo version here:

http://glinksmobile.com/

I've tested this on several phones, and obviously my computer - and it seems to pick them up perfectly (and use the right template set).

As you can see - we are using the luna template set as the standard (for browsers) ... and then when it detects you are on a mobile, it will instead use the "mobile" template set.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Mobile template In reply to
Hi Andy,

I just tested on my browser, blackberry tour and on my ipod touch browser (iPhone like).

It worked nice on my Browser and on my Blacjberry but on my iPod it took the "normal" browser template set.

Jesus
Quote Reply
Re: [Jesus] Mobile template In reply to
Hi,

Mmm ok - can you do a test for me, add this script to your site:

Code:
#!/usr/bin/perl

print "Content-Type: text/html \n\n";
print "ENV: $ENV{HTTP_USER_AGENT}";

(call it test.cgi, for simplicity) ... obviously CHMOD it to 755 :)

..and call it from your mobile. Can you post here (or message me), with the output of that script?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Mobile template In reply to
Hi Andy,

I'm not on my computer right now, I just tested yours.
Quote Reply
Re: [Jesus] Mobile template In reply to
Ah ok - I've added it into the site here:

http://glinksmobile.com/

Below the number of links. Mine for example (on the PC), shows:

Quote:
Browser: ENV: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Mobile template In reply to
Never mind - I've fixed it. For some reason the list was missing "ipod" and "iphone" ...

I'll email you a new copy of the plugin in a bit

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Mobile template In reply to
Now it loads perfectly!

I'm trying to create a test install of the plugin and test the admin features.