Quote:
Originally Posted by tbworld
PHP Code:
// Three templates were created. // 1. block_custom - Custom block php/html template // (Cloned from "block_html" template with added <vb raw variables> listed below). // 2. my_template name - to be inserted in "block_custom" // 3. ad_template - to be inserted in "block_custom"
// Outputs to "block_custom" <vb: raw content>, as inserted custom template vB_Template::create('my template name'); $templater->register('var1', $var1); // Other template variables $templater->register('var2', $var2); // results outputted from PHP. $output = $templater->render();
// Output "ad_template" --- outputs to "block_custom" <vb:raw ad_location> $templater = vB_Template::create('ad_template'); $templatevalues['ad_location'] = $templater->render(); vB_Template::preRegister('block_custom', $templatevalues);
This is probably not exactly what you are looking for, but you can derive it from this.
This was modeled after the page @Lynne referred you to, it is revised for forum blocks.
|
Thanks, but i did not understand very well this way
I do created three templates ? Then what? How will the template show inside the block?
I reviewed the solutions here
https://vborg.vbsupport.ru/showthread.php?t=293516
But it did not work with me

becouse he put all php code inside block , but iam Use plugin .
--------------- Added [DATE]1400632326[/DATE] at [TIME]1400632326[/TIME] ---------------
when i put anything without variables , it Show inside block
so , this code is work good ,
PHP Code:
$templater = vB_Template::create('my_template');
return $templater->render();
but problem now that variables do not work in the block ؟!