|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
sarahfoxnz Smarty Regular
Joined: 11 Apr 2010 Posts: 76
|
Posted: Sat Jan 16, 2016 9:35 pm Post subject: How to create MOBILE templates ? |
|
|
{include file="$_lang/$_format/header.tpl"}
Hello.
so far, i've only got one set of templates
english/html/header.tpl with 17 different templates/pages
I'm thinking of creating a set of 'mobile' templates and am wondering
1) Minor query:- Using PHP, what do you use to detect a mobile-phone device & not a PC ?
2) Main Smarty query:-
When i do create a set of mobile phone templates, i'll probably take a few weeks & not done overnight..
Is there a way to say "if a mobile phone template does not exist, use the default HTML template".
I dont want mobile phone users to have broken pages while I transition.
Is this possible & how do we set a "default" setting, if one or more of the templates dont exist ?
(I think i use 3 template/pages at most on any one URL).
Example.
the 'side' menu & header may have a 'mobile' template, but the main content only exists in html (template) format.
If a mobile-phone user views the site the 'mobile' header / side menu are using the 'mobile' template, but then uses the default html format template for the main content.
PS - this will be my 1st 'mobile' site so i dont think i'll use a side menu :) |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Sun Jan 17, 2016 11:17 am Post subject: |
|
|
You're asking a wrong question.
There should be no "transition".
You just create a new set of templates. |
|
Back to top |
|
sarahfoxnz Smarty Regular
Joined: 11 Apr 2010 Posts: 76
|
Posted: Mon Jan 18, 2016 5:40 am Post subject: |
|
|
AnrDaemon wrote: | You're asking a wrong question.
There should be no "transition".
You just create a new set of templates. |
What if you have a LARGE website with hundreds of template files.
basiaclly i want to upload - Look/teson my own mobile phone. If it needs changes - fix em...
Then - work on the next template - It can take weeks etc..
So.. do you just create templates & remove them from the website after each test ?
& when youre finished, upload them all at the same time ?
How about testing - i dont want to upload the individual files one at a time - & test each one. I want a gradual change.
What happens if a mobile phone user goes to my website while im testing ? They'll get broken websites.. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Jan 18, 2016 5:53 am Post subject: |
|
|
To do templates the the modern "responsive" way is to build one template that responds to any screen size. Don't bother trying to identify what client is being used. Have a look at CSS frameworks such as Twitter Bootstrap. Smarty itself is indifferent. As for testing, you should have a separate test environment. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Mon Jan 18, 2016 1:28 pm Post subject: |
|
|
sarahfoxnz wrote: | AnrDaemon wrote: | You're asking a wrong question.
There should be no "transition".
You just create a new set of templates. |
What if you have a LARGE website with hundreds of template files. |
Then it is time to make a new theme. In all honesty, I can't imagine a website template grow beyond 50-60 files, and that including everything plus technical templates. Like SVG wrappers. Just counting on my fingers, one wrapper, one template for each category type, one for each page block.
You have to stretch it hard to reach a hundred.
Quote: | basiaclly i want to upload - Look/teson my own mobile phone. If it needs changes - fix em... |
You ABSOLUTELY MUST have a separate testing environment.
This is not up for discussion. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|