The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to include a template in other template?
How can I include a template in other template?
Like in the template 'vbcms_page', the templates 'header', 'navbar', etc, are including by '{vb:raw xxx}'. I tried to do it like this, but it didn't worked. Any help? Tnx. |
#2
|
||||
|
||||
You have to render the initial template and store it in a variable, then register that variable for use in the second template, and add it into the second template as a raw variable.
|
#3
|
|||
|
|||
How do I do it...?
I'll be happy if you will explain a little. |
#4
|
||||
|
||||
INstantiate the template with vB_Template::create
PHP Code:
PHP Code:
|
#5
|
|||
|
|||
I didn't understand. I tried something, but it isn't working.
Where shpuld I put those codes? I understand what should I do from Paul M, but I dont know how to do it. I will be happy id you will explain depper. Tnx for attitude. |
#6
|
||||
|
||||
Check this thread : https://vborg.vbsupport.ru/showthread.php?t=228078
|
#7
|
|||
|
|||
Got it. but still...:
When im adding the template to a raw variable, and showing it on the template 'vbcms_page', it works. But when im adding this to the 'header' template, id doens't. Here is the plugin: HTML Code:
$abcHTML = vB_Template::create('DK')->render(); vB_Template::preRegister('header', array('var' => $abcHTML)); vB_Template::preRegister('vbcms_page', array('var' => $abcHTML)); I think the HOOK location isn't good. the location is: process_template_complete. but if this is really the problem, why? and i will be happy for a little explain about 'HOOK'. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|