The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I'm trying to add a new template to my layout. The help says "When adding custom templates, in order to have them parsed, you must also write PHP code to call them." How I do that? And how I use my new template in another one?
|
#2
|
||||
|
||||
![]() |
#3
|
|||
|
|||
![]()
Thank you very much for your answer, nico_swd, but this is not what I need to do (in fact, I knew that article
![]() I assume, I need to write a plug-in in some place to process the contents of the template and store them in that variable? |
#4
|
|||
|
|||
![]()
Your first need to cache the template then parse it.
The plugin hooks are called: cache_templates parse_templates |
#5
|
|||
|
|||
![]() Quote:
Could you, please, point me where I can find an example of those plugins implemented? Lots of thanks in advance. |
#6
|
|||
|
|||
![]()
In cache templates
Code:
$globaltemplates = array_merge($globaltemplates, array('YOURTEMPLATE')); Code:
eval('$YOURVARIABLE = "' . fetch_template('YOURTEMPLATE') . '";'); |
#7
|
||||
|
||||
![]()
When including one template in another what you actually do is eval the inner tamplate to a variable and then pass that variable to the outer template.
So for instance say you had a really simple innerTemplate that wraps <tr> tags around a series of entries you might have this code PHP Code:
Now you have a string ($innerBit) which contains a concatenation of the innerTemplate. You can simply then pass this variable to the next layer of template. |
#8
|
|||
|
|||
![]()
Thank you lots, Eikinskjaldi and Enigma. All this information has helped me a lot, and I've been able to complete my litlle project. I owe you both a free drink
![]() BTW, just saw at the main page od the forums... Happy birthday Enimga!!! Now I owe you two drinks ![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|