The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Call a template in another template!
Hi, I've a template called "mytemplatetest", and I want call it in another template, if possible. I've try with $mytemplatetest (viewing the called $footer, $header, etc., templates), but it doesn't work.
Can you please help me? Best regards, Mr Pink (aka Norman) Web City Forum Online http://www.web-city.it/ |
#2
|
||||
|
||||
You can't include other template files in a template file, you need to parse it separately in php code.
If you want to include that template on every page, then open global.php, find this: Code:
$globaltemplates = array_merge($globaltemplates, array( // the really important ones 'header', 'footer', 'headinclude', Then find this: Code:
// parse some global templates eval('$gobutton = "' . fetch_template('gobutton') . '";'); eval('$spacer_open = "' . fetch_template('spacer_open') . '";'); eval('$spacer_close = "' . fetch_template('spacer_close') . '";'); Code:
eval('$mytemplatetest = "' . fetch_template('mytemplatetest') . '";'); Or write a hack that uses "parse_templates" hook to parse your template. |
#3
|
||||
|
||||
Thanks really for your reply, CyberAlien.
So I need to put the entire code into the navbar template (I'm making a style, and I don't want use external files/modifications). |
#4
|
||||
|
||||
There is another solution: replacements. Create replacement like "<my-header>", put your code in it, then use <my-header> in navbar template. < and > in replacement name are there to make sure there isn't any similar text within posts so nothing else will be replaced.
|
#5
|
||||
|
||||
The problem is that I'm trying to do a vB style that I'll posting here like a simple release (I'm doing it for learn coding and take familiarity with vB), so I can't use other resources rather then the simple template modification.
|
#6
|
||||
|
||||
Replacements are simple template modifications that you can safely use.
|
#7
|
||||
|
||||
If a user will download the style, then he will need to add the replacement, right?
|
#8
|
||||
|
||||
No, it will be in xml file.
|
#9
|
||||
|
||||
Oh, so I can use them. Great! I thought that users had to add them by themselves! Ok ok, great! Thanks again man. Now my problem is that in the other thread in this forum!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|