Inclusio Exclusio - Global header and footer template files?
Posted by Fade2k
|
Inclusio Exclusio - Global header and footer template files? February 08, 2010 04:16PM |
Registered: 19 years ago Posts: 34 |
Inclusio unius est exclusio alterius - Inclusion of one is the exclusion of another.
Is it possible to force templates that do not have template files in them to include the template files from the default template?
Erm, I'm a bit lazy and don't really want to update headers and footers or anything else for that matter on forums that have their own templates. I just want the template directory to change (or override the default) if it exists.. otherwise I wanted to forum to use the default. Possible?
Sorry if the subject of this thread is off at all, wasn't really sure what to put there.
Is it possible to force templates that do not have template files in them to include the template files from the default template?
Erm, I'm a bit lazy and don't really want to update headers and footers or anything else for that matter on forums that have their own templates. I just want the template directory to change (or override the default) if it exists.. otherwise I wanted to forum to use the default. Possible?
Sorry if the subject of this thread is off at all, wasn't really sure what to put there.
|
February 08, 2010 06:29PM |
Admin Registered: 21 years ago Posts: 8,532 |
Possible: not by default. Phorum does not handle templates like this. You always need the full set of template files to make things work. Options that I see:
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
- This is not an issue, since the template files do not change that often (5.2 and 5.3 will use the same templates for example)
- This is an issue, but you think of a way to create one template which has dynamic headers and footers built into the header and footer template, so in the end you only use one template.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
February 09, 2010 10:58AM |
Admin Registered: 25 years ago Posts: 4,495 |
Quote
Maurice Makaay
This is an issue, but you think of a way to create one template which has dynamic headers and footers built into the header and footer template, so in the end you only use one template.
Yeah, that is easy to do. Just put a header.php file in the template dir that does the work. .php files are favored over .tpl files by the template system.
<?php
switch($PHORUM["DATA"]["forum_id"]) {
case 1:
include phorum_api_template('header-1');
break;
case 2:
include phorum_api_template('header-2');
break;
default:
include phorum_api_template('header-default');
break;
}
?>
Or, something like that.Brian - Cowboy Ninja Coder - Personal Blog - Twitter
|
Re: Inclusio Exclusio - Global header and footer template files? February 09, 2010 04:19PM |
Registered: 19 years ago Posts: 34 |
Thank you Brian Moon, pretty close to what I was looking for... however I was more concerned over how many files there would be than actually including parts. It does however make it easier for updates in that I would only have to upload a couple of files.
I'll probably stick to option one as presented by Maurice Makaay... I can just copy and past changed files into the template directories. Just seems simpler that way.
Thanks guys!
~ Be Kind, Please Rewind! ~
I'll probably stick to option one as presented by Maurice Makaay... I can just copy and past changed files into the template directories. Just seems simpler that way.
Thanks guys!
~ Be Kind, Please Rewind! ~
|
February 09, 2010 05:13PM |
Admin Registered: 21 years ago Posts: 8,532 |
If you stick to the basic rules of engagement, then upgrades should not be hard to do. If you create your own template directory and apply any customizations to Phorum through modules, then upgrading is a blind copy of the files in the new distribution.
For the templates, we have the rule to not change them during a stable release (e.g. any 5.2.X release), so some kind of inheritance system would be nice, but not required because of this rule. When there is a new version that needs a new template, you might have to redo your templating anyway.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
For the templates, we have the rule to not change them during a stable release (e.g. any 5.2.X release), so some kind of inheritance system would be nice, but not required because of this rule. When there is a new version that needs a new template, you might have to redo your templating anyway.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Sorry, only registered users may post in this forum.