ASPX templates
Version 5.x > ASPX templates > Change out templates at runtime View modes: 
User avatar
Member
Member
kheon-pixelmedia - 3/9/2011 9:23:33 AM
   
Change out templates at runtime
We are building a relatively small, simple informational site that also have to be mobile friendly. We have custom designs for the mobile display.

We do not want to have to duplicate the content in any way, nor have to redirect to a "mobile" section inside Kentico.

We are going to use Device Atlas to sniff and identify devices and then we want to be able to dynamically set the master page, page templates, etc.

I can't seem to find any documentation online on how to do this while leveraging Kentico. Do we have to take this down to the ASP.NET layer and handle it there?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 3/16/2011 11:49:33 AM
   
RE:Change out templates at runtime
Hi,

The easiest way would be adding to the page templates some panels (zones) and/or page placeholders and set them to show/hide according to your needs. It is easier to set these in the code behind to detect normal or mobile browser and show/hide them.

Changing templates on the fly is very complicated and the engine was not designed for this.

Best regards,
Juraj Ondrus

User avatar
Member
Member
JD - 10/9/2012 10:02:28 AM
   
RE:Change out templates at runtime
Thank you, that gives me a great place to start figuring this out.