We want to build a mobile site which supports phones and tablets. Since tablets have a bigger screen we want to build separate HTML for it, but without using a responsive design. The site will be one tree in Umbraco so we're thinking about switching between templates based on the capabilities of the device. I saw this: http://www.hanselman.com/blog/NuGetPackageOfTheWeek10NewMobileViewEnginesForASPNETMVC3SpeccompatibleWithASPNETMVC4.aspx and was wondering if this was the way to go using Umbraco 4.11. Are there any thoughts on what's the way to go for this?
For now i added a 'master' controller which all my custom controllers (which build a custom model in 90% of the pages) inherit from. In that controller i have the following to do the switch between templates. For the mobile capability detection we're using http://blog.mobileesp.com/
public class BaseController : Umbraco.Web.Mvc.RenderMvcController
{
public override ActionResult Index(RenderModel model)
{
var context = System.Web.HttpContext.Current;
var currentTemplate = base.ControllerContext.RouteData.Values["action"].ToString();
if (currentTemplate.Contains("MobilePhone"))
{
//user is in mobile site and can be redirected
var mobileDetection = new MobileDetection(context);
if (mobileDetection.DetectTierTablet())
{
var newTemplate = currentTemplate.Replace("MobilePhone", "MobileTablet");
if (this.EnsurePhsyicalViewExists(newTemplate))
{
//it's a tablet, return the alternate tablet-view
return View(newTemplate, model);
}
}
}
return base.Index(model);
}
}
Look at something like Twitter Bootstrap that will allow you to create a Responsive Design website where no matter what your resolution of the phone/tablet/screen, you can have a design that matches it without having to create new templates.
Mobile template in 4.11
Hi all,
We want to build a mobile site which supports phones and tablets. Since tablets have a bigger screen we want to build separate HTML for it, but without using a responsive design. The site will be one tree in Umbraco so we're thinking about switching between templates based on the capabilities of the device. I saw this: http://www.hanselman.com/blog/NuGetPackageOfTheWeek10NewMobileViewEnginesForASPNETMVC3SpeccompatibleWithASPNETMVC4.aspx and was wondering if this was the way to go using Umbraco 4.11. Are there any thoughts on what's the way to go for this?
have you looked at http://51degrees.mobi/?
You can serve different paths to different devices depending on detection .... [say that 10 times fast!]
Hope this helps!
J
For now i added a 'master' controller which all my custom controllers (which build a custom model in 90% of the pages) inherit from. In that controller i have the following to do the switch between templates. For the mobile capability detection we're using http://blog.mobileesp.com/
Any more thoughts on how it's solved?
Look at something like Twitter Bootstrap that will allow you to create a Responsive Design website where no matter what your resolution of the phone/tablet/screen, you can have a design that matches it without having to create new templates.
is working on a reply...