Quote:
Originally Posted by kh99
You would need to use a plugin. In the plugin you'd set up any variables you need, register them to your template, then render the template and save the output in a variable. You'd then register that variable to the postbit template, and then use 'vb:raw' in postbit to put it where you want.
I know that sounds complicated, but it's not really that difficult. There's an article here on how to render a template: https://vborg.vbsupport.ru/showthread.php?t=228078
|
Appears a bit complicated also in the article, can't you write me some specific example for my problem?
For example, I have a custom template called "targhette" (that contains the code I've posted above) and i want to call it with {vb:raw targhette} in postbit_legacy and memberinfo, how I can do this?
I need to create a new plugin with this code? Is this correct?
PHP Code:
$templater = vB_Template::create('targhette');
$templater->register_page_templates();
$templater->register('my_var', $my_var);
$templater->register('my_array', $my_array);
print_output($templater->render());