Page 1 of 1
Template change for mobile site
Posted: Thu Aug 08, 2013 8:47 pm
by skarni
Does CMSMS have any options to automatically load a different template if a mobile browser or resolution is detected? I know there are solutions out there for changing the css depending on the above, but nothing on changing the template.
Re: Template change for mobile site
Posted: Thu Aug 08, 2013 9:20 pm
by Rolf
CGExtentions has that feature, check help text
Re: Template change for mobile site
Posted: Fri Aug 09, 2013 1:03 pm
by skarni
Looks to me like I'd have to know how to manipulate smarty or program something to get it to work using CGExtensions.
Re: Template change for mobile site
Posted: Fri Aug 09, 2013 2:42 pm
by velden
skarni wrote:Looks to me like I'd have to know how to manipulate smarty or program something to get it to work using CGExtensions.
Isn't that true for anything you'd like to customize in CMSMS?
Yes it is. At least a little understanding of smarty is a requirement to get create a page template or news template. Unless you're happy with the default theme as it comes with the installation.
Re: Template change for mobile site
Posted: Fri Aug 09, 2013 3:04 pm
by skarni
Its easy to utilize the syntax described in help files to modify smarty tags, but creating them without a guide is entirely different. I can easily transform a regular Html template into CMSMS.
Re: Template change for mobile site
Posted: Fri Aug 09, 2013 3:12 pm
by velden
Re: Template change for mobile site
Posted: Fri Aug 09, 2013 3:12 pm
by Jo Morg
skarni wrote:Its easy to utilize the syntax described in help files to modify smarty tags, but creating them without a guide is entirely different. I can easily transform a regular Html template into CMSMS.
Rolf wrote:CGExtentions has that feature, check help text
CGExtentions help text wrote:{cge_is_smartphone [assign=name]} - function plugin
Description: A plugin to detect wether the request is from a smart phone such as an iphone or android.
i.e: {cge_is_smartphone assign='isbot'}{if $isbot}<h3>I should do some funky mobile styling here.</h3>{/if}
Simpler than that????

Re: Template change for mobile site
Posted: Fri Aug 09, 2013 3:21 pm
by skarni
I'll try the link out. The code displayed, as far as I understand, identifies the current device used, but does not include code to tell CMSMS what template to use in response. That's beyond my ability.

Re: Template change for mobile site
Posted: Fri Aug 09, 2013 6:19 pm
by Dr.CSS
I don't think it's made to change the whole template as they are attached to the page but more like...
{if mobile} don't show this {else} show this {/if}
This would change the template to show more or less or different content to mobile devices so you don't need a new/different template just change what is shown to different devices...
Re: Template change for mobile site
Posted: Fri Aug 09, 2013 6:37 pm
by uniqu3
Currently there is nothing that would make it possible switching complete Template based on device, only way is like DrCSS mentioned by conditional statements in your template.
You can use CGExtensions Module or mobiledetect (
http://dev.cmsmadesimple.org/projects/mobiledetect) plugin for which you can also check Help on Github
https://github.com/uniqu3/mobiledetect and see if you are capable using or trying it.
In upcomming version 1.11.8 announcement here
http://forum.cmsmadesimple.org/viewtopi ... =1&t=67481 you can see that a core event is about to be added that will make it possible to write a module or some other solution for template switching. For example if somebody finds time fixing and updating CMSTouch
http://dev.cmsmadesimple.org/projects/cmstouch