The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to insert custom template into vB 4.1 template
Hi,
I use vB4.1 I'd like customize my sidebar on memberinfo page. I would like add a custom template that I created before into somewhere in sidebar. I create a new template called name 'mycustomtemplate' Code:
<h2>{vb:raw testVarName}</h2> <ul> <li>Item 1</li> <li>Item 2</li> </ul> Code:
$testVarName = 'testValue'; $templater = vB_Template::create('mycustomtemplate'); $templater->register('testVarName', $testVarName); $templater->render(); Code:
$cache[] = 'mycustomtemplate' Code:
{vb:raw mycustomtemplate} However, when I visit my profile page, my custom template's content cannot be displayed. I don't know what and where my problem is. Please check and help me for this issue. Thanks! |
#2
|
|||
|
|||
Fixed:
In plug-in, I added following code: Code:
$testVarName = 'testValue'; $templater = vB_Template::create('mycustomtemplate'); $templater->register('testVarName', $testVarName); $customtemplate = $templater->render(); vB_Template::preRegister('MEMBERINFO', array('mycustomtemplate' => $customtemplate)); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|