Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

Commented Feature: Feature Request: Support Mobile rendering of Functions and Templates [1711]

$
0
0
With ASP.Net Web Pages 2.0 the concept of Mobile views [was introduced](http://www.asp.net/web-pages/tutorials/working-with-pages/rendering-aspnet-web-pages-sites-for-mobile-devices). Normal webforms also got it with the [Microsoft.AspNet.FriendlyUrls](https://aspnetfriendlyurls.codeplex.com/).

In both cases the idea is that whenever you have a file named MyPage.cshtml or MyPage.aspx, you can create a new set of files called MyPage.Mobile.cshtml or MyPage.Mobile.aspx and ASP.Net will automatically be smart enough to choose the Mobile view when its a mobile device requesting the url.

So without much further introduction i suppose the readers by now has figured out where i'm getting at; this file scheme should be supported by Composite C1 as well for .master, .cshtml, .xslt etc.

Myself, [i'm already supporting it at MasterPage template level](https://bitbucket.org/burningice/compositec1contrib/src/94f2e3b5715b0a6b99d10d48a45023903319e489/Rendering.MasterPages/Web/MasterPageModule.cs?at=default#cl-59), plus i implemented the [BrowserHelpers-class](http://msdn.microsoft.com/en-us/library/hh396628(v=vs.111).aspx) which was introduced in WebPages 2.0 to override a mobile device to mimic it being a desktop and vice versa.
Comments: ** Comment from web user: burningice **

As of C1 4.3, i've replaced the custom implementation of the [BrowserHelper](http://theshravan.net/blog/browser-overriding-features-in-asp-net-mvc-4/) class with the native ones shipped in WebPages 3. This also means the usage of the [DisplayModeProvider](http://www.c-sharpcorner.com/UploadFile/b696c4/display-mode-provider-in-mvc-5-application/) class, which support adding custom modes and resolving.

https://bitbucket.org/burningice/composite-c1-community-edition/commits/93f3b782c0a0a9996ecaa32b6eef519d52840e3b


Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>