EnglishOn gallery side, the default template_dir is now an array.
If the template file exist as today in the template directory, no behaviour change.
But if the template file is missing...
The code checks in $themeconf['modeling'] the template model to use.
Case 1 - A new template called "newbe" as no .tpl files but in themeconf.inc.php
you have:
$themeconf['modeling'] = 'yoga';
=> all .tpl files (header.tpl, index.tpl, etc.) could be found in the yoga template.
Case 2 - A new template called "oldbe" as no .tpl files but in themeconf.inc.php
you DO NOT have:
$themeconf['modeling'] = 'yoga';
=> all .tpl files (header.tpl, index.tpl, etc.) could be found in the template-common/yoga/ directory.
Case 3 - A new template called "Advanced" as some .tpl files but in themeconf.inc.php
you have:
$themeconf['modeling'] = 'yoga';
=> .tpl files (header.tpl, index.tpl, etc.) could be found in the template/Advanced directory.
if not found (missing files)
=> .tpl files (header.tpl, index.tpl, etc.) could be found in the template/yoga directory.
if not
=> .tpl files (header.tpl, index.tpl, etc.) could be used if they are in the template-common/yoga/ directory.
New feature in trunk: [Subversion] r5071
Offline
Hi VDigital,
By email, you have asked me to move current *.tpl files from template/yoga to template-common/yoga.
Are you sure it won't be more logic to just move them to template/default instead? (I would find this more "readable" in the directory organization) Tell me if there's something I'm missing.
Online
My idea is to make a full copy into template-common (so people might remove yoga itself).
Distribute template/yoga/ with only frequent overridden .tpl , I mean:
- header.tpl
- picture_content.tpl
- mainpage_categories.tpl
- thumbnail.tpl
Ideally I would like a comment above each code:
{* Warning: This file is distributed as an example, core distributed tpl files are distributed in template-common/default/ *}
So I think you've reached and shared my full view on this feature.
;-)
Offline
template-common/default is not good. Either we have *.tpl directly under template-common or we have template/default.
We only add "default" under template-common because there are other files in template-common.
I much prefer template/default
Online
Do as you want, on that point.
I just recommend my last personnal conclusions after my personnal usage of it.
Personnaly, I dislike to see "default" in all template/theme selection boxes.
That one of reasons I recommended to locate it in template-common.
Offline
VDigital wrote:
Personnaly, I dislike to see "default" in all template/theme selection boxes.
Of course, template/default won't be seen in the theme selection : 1) there is no theme in template/default, right? 2) we can filter the list
I don't say "rename yoga to default". I say "move template/yoga/*.tpl" to "template/default/". The themes stay in yoga/theme
Online
Then please move *.tpl from yoga to default.
Do as you want, I wrote. No problem on my side.
;-)
Offline
VDigital wrote:
Then please move *.tpl from yoga to default.
Job's done. It works like a charm. I think it's really a nice technical improvement and I hope it will increase template designer happiness :-)
Online
Yes.
Following the logic of template/distributed/,
could you explain why template-common is not in template/distributed/ then
and why template-extension is not a subdirectory template/extension/ ?
Because if I want to have a template called extension I can't.
So if I want to have my own template called distributed, could I do it?
Anyway it is fine to me.
;-)
Last edited by VDigital (2010-03-09 22:02:21)
Offline
I don't understand why you ask these questions once I did the move while you said 2 posts above : No problem on my side
Online
You were so convinced you were right.
template-common and template-extension have been created by Chrisaga and at that time you didn't tell us any remark to move them in template.
Please consider now these basic questions. And do as you want.
Offline
VDigital,
I'm concerned a bit about performance.
My web site (as most of them) use a very slow disk (NAS like). I had some gained by putting $conf['template_compile_check'] = false; (by putting this line we don't check the file modification time of the original .tpl)
With your system I have the feeling (not sure) that you are going to check the existence of the tpl in several directories ... Can you take this issue into account please ?
Tks
Offline
Yes, I already thought on that case.
I suggest a new option.
if (!defined('IN_ADMIN') and ($conf['modeling']==true or !isset($conf['modeling'])) )
Then your personal template must be exhaustive if your turn it false.
Is that solution suit you?
Offline
VDigital wrote:
if (!defined('IN_ADMIN') and ($conf['modeling']==true or !isset($conf['modeling'])) )
Then your personal template must be exhaustive if your turn it false.
Is that solution suit you?
As far as I understand, the webmaster can't choose to activate template_modeling or not. It's a template property. If you use yoga, you already use template modeling.
Beyond rvelices (who has enough technical skills to compute a template), forcing the user to have its "personnal" template is not possible.
To solve the potential performance issue for low disk hosting, couldn't we have a "cache" of the location of each tpl file for a given template instead?
Online
First, we already have a cache.
Next, rvelices implemented a check on realpath to detect any change.
More, a standard cache process exists in Smarty and detect any file change or directory change.
(If I read well on Smarty website).
Moreover, you really need 3/4 tpl files (most used) in your template to keep at level your performance.
Finally, I think we can code (a better way than my previous proposal):
$modeling = get_themeconf('modeling');
if (!defined('IN_ADMIN') and ($modeling !== false) )
So if $themeconf['modeling'] is not set or set with a model we will take advantages of modeling.
If $themeconf['modeling']===false we will keep advantage of old behavior/performance (but its constraint is to have of all .tpl files available in the template directory).
;-)
Offline