Template change for mobile site

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
skarni
Forum Members
Forum Members
Posts: 43
Joined: Thu Dec 16, 2010 5:28 pm

Template change for mobile site

Post 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.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Template change for mobile site

Post by Rolf »

CGExtentions has that feature, check help text
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
skarni
Forum Members
Forum Members
Posts: 43
Joined: Thu Dec 16, 2010 5:28 pm

Re: Template change for mobile site

Post 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.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Template change for mobile site

Post 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.
skarni
Forum Members
Forum Members
Posts: 43
Joined: Thu Dec 16, 2010 5:28 pm

Re: Template change for mobile site

Post 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.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Template change for mobile site

Post by velden »

User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1973
Joined: Mon Jan 29, 2007 4:47 pm

Re: Template change for mobile site

Post 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???? :)
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
skarni
Forum Members
Forum Members
Posts: 43
Joined: Thu Dec 16, 2010 5:28 pm

Re: Template change for mobile site

Post 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. ???
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Template change for mobile site

Post 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...
uniqu3

Re: Template change for mobile site

Post 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
Locked

Return to “[locked] Installation, Setup and Upgrade”