View Full Version : Call plugin from template
PanterSi
02-06-2011, 05:57 PM
In version 3.85 from template I call plugin named "myplugin", and then in template show the content of this plugin. Now, in 4.1 I made the same thing, but there is no content show, just name of plugin $myplugin. What is wrong?
Lynne
02-06-2011, 06:20 PM
You need to register all variables for use in templates in 4.x. Also, you would not enter $myplugin, you would enter {vb:raw myplugin}
Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide (https://vborg.vbsupport.ru/showthread.php?t=228078)
PanterSi
02-11-2011, 10:28 AM
I have plugin "left_panel", hook location is global_start:
ob_start();
include('MySource/links.php');
$templatevalues['left_panel'] = ob_get_contents();
ob_end_clean();
vB_Template::preRegister('ss_leftcolumn_contents', $templatevalues);
In template "ss_leftcolumn_contents" I have some html code and call {vb:raw left_panel}. Html code show ok, but content of left_panel is not visible. Why?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.