Quote:
Originally Posted by kh99
That's pretty close. I think like this:
Code:
$templater = vB_Template::create('targhette');
$templater->register_page_templates();
$templater->register('my_var', $my_var);
$templater->register('my_array', $my_array);
$targhette = $templater->render();
vB_Template::preRegister('postbit_legacy', array('targhette' => $targhette));
and using hook postbit_display_complete, probably. For memberinfo you'd need another plugin (and change the template name in preRegister, of course). For that one use hook member_complete instead. Also, there is no $post for the memberinfo, but the user's info is in $userinfo, so you could just put $userinfo in place of $post in the register call. If you leave the name in the register call as 'post' then you can use the same template.
Edit: oh, I'm assuming that you know that the my_var and my_array register lines are just examples. If you use variables in your custom template, you'd want to replace those two lines with one or more lines to register your variables.
|
I've got this working for the postbit, but now i'm having problem to get this work in user profile, I need to use the same template (targhette) but in this page.
I'm trying with this plugin:
PHP Code:
$templater = vB_Template::create('targhette');
$templater->register_page_templates();
$templater->register('userinfo', $post);
$targhette = $templater->render();
vB_Template::preRegister('memberinfo_block_ministats', array('targhette' => $targhette));
And I write {vb:raw targhette} in memberinfo_block_ministats, but doesn't work.
The template hook i'm using is member_complete.