How to make a hostname force the mobile layout?

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
7/15/2012 3:58:21 PM
Gravatar
Total Posts 27
https://ict.ken.be
Hybrid coding since
the dawn of time.

How to make a hostname force the mobile layout?

Hello again,

Is there a way to let m.mydomain.com force the mobile skin on mojoportal?

The best I could come up with is, deploy a second identical front-end with the mobile skin as site skin, but it seems that this is redundant and not good for seo. Actually when I think of it,  can not be very hard to add this to the preffered hostname setting. 

K

 

7/15/2012 3:59:01 PM
Gravatar
Total Posts 27
https://ict.ken.be
Hybrid coding since
the dawn of time.

Re: How to make a hostname force the mobile layout?

Ah, and where do I find your buy me a beer buttons again :)

7/19/2012 1:02:53 PM
Gravatar
Total Posts 18439

Re: How to make a hostname force the mobile layout?

Using a different host name for mobile is not good for SEO, if it is the same site you really don't want to duplicate content at a different host name.

Forcing a preferred hostname means only one host name is really used all the other host names are redirected to the preferred host name and this improves SEO by not having multiple urls for the same content.

If you really want a separate host name for mobile that implies a second site and you can make the second site use a skin designed for mobile.

But I think it is best to not use a separate host name and not try to use host name as a mechanism for changing skins. You can use a separate skin for mobile but that is something detected from a fragment of the user agent string that identifies it as a mobile device. You can tweak the string fragments that are used in mojoPortal to detect a mobile device as mentioned in the documentation for our Mobile Kit Pro Add on.

In site settings you specify the mobile skin and if the fragment is contained in the user agent string for the device then it will apply the mobile skin.

The default setting is like this but you can copy it to user.config and modify it:

<add key="MobilePhoneUserAgents" value="iphone,ipod,android,iemobile" />

you can add or remove fragments in this comma separated string to make it detect or not detect specific devices as being "mobile" as long as you can find a unique fragment in the actual user agent string of the device. One problem with android for example is that I don't know a way to determine android phone from android tablet whereas ipad is different from iphone. For a larger tablet screen I think the main skin should be used, only for the very small screens of mobile phones do we really need radically different design.

Of course you could also use a different strategy, rather than detecting mobile devices and changing skins just using responsive design in css with media queries to adjust for screen sizes so that one skins works/adapts for all devices.

7/21/2012 6:43:18 AM
Gravatar
Total Posts 27
https://ict.ken.be
Hybrid coding since
the dawn of time.

Re: How to make a hostname force the mobile layout?

I understand what you are saying. Since I had some time this morning I looked into mojobasepage, MobileSkinLink and mojobasepage.

Was there any reason for only including the MobileSkinLink only when mobile is detected?

I think I will change my implementation to:

  • user goes to domain.com: sees full site + mobileskinlink
  • user goes to domain.com has mobile device: sees mobile version + mobileskinlink
  • user goes to m.domain.com: sees mobile version + mobileskinlink (will end up on domain.com but with mobile version)
  • user chooses mobile by using mobileskinlink or m.domain.com: domain.com will show mobile version until mobileskinlink is used again. (only for the session or persisted with a cookie)

Since m.domain.com would work the same as the 'mobile detector' there are no duplicate issues, but the user has the freedom to choose for mobile whenever they want. (having in mind older phones and people with sight disabilities)

What do you think about this ?

7/25/2012 8:26:16 AM
Gravatar
Total Posts 18439

Re: How to make a hostname force the mobile layout?

Sounds ok to me if it meets your needs.

Note that in the latest version of mojoPortal you can add this in user.config:

<add key="AllowMobileSkinForNonMobile" value="true" />

to make it always show the mobile skin link and allow using the mobile skin even without a mobile device. It toggles a cookie when you click that link.

Hope that helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.