I'm trying to convert over a vb3 product to vb4, and am running into an issue with the template system. Specifically, I am having trouble passing a variable to be outputted from within the template.
I am using the following code in a plugin which has the hook location of threadbit_display:
PHP Code:
$templater = vB_Template::create('custom_template');
$templater->register('my_var', $my_var);
$templatevalues['custom_template'] = $templater->render();
vB_Template::preRegister('threadbit', $templatevalues);
Then in the style manager for threadbit, I added the following :
{vb:raw custom_template}
Unfortunately, it didn't work. Also tried {vb:raw custom_template.my_var} and it didn't work.
I've turned on dev mode, and custom_template appears under the list of template usage. It is highlighted in red though - I don't know what that means.
Anyone have any ideas?