View Full Version : Adding a template within a template
myristate
03-18-2013, 06:10 PM
I have created a new template called "news" within it it has a generic news layout that i want to be able to include in other certain templates. How can i register this template so that in a certain custom template i could do the following {vb:raw news} to insert the content of that template file
Lynne
03-18-2013, 06:13 PM
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)
myristate
03-18-2013, 06:30 PM
Thanks that was aweosme, Simple three lines into my created plugin and works a charm!
$templater = vB_Template::create('news');
$templatevalues['news'] = $templater->render();
vB_Template::preRegister('FRONTPAGE', $templatevalues);
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.