View Full Version : How to call another forumbits templates
Santori
03-19-2011, 11:38 PM
Hello!
I have a second forumbits templates...
In the forumhome template I tried to change this
<!-- main -->
{vb:raw template_hook.forumhome_above_forums}
<ol id="forums" class="floatcontainer">
{vb:raw forumbits}
</ol>
{vb:raw template_hook.forumhome_below_forums}
<!-- /main -->
To:
{vb:raw secondforumbits}
This not works.....
What I need yo make call this variable, register? How?
Thank you in advance!
BirdOPrey5
03-20-2011, 04:03 PM
Sounds like you need a plugin to pre-register your secondforumbits variable...
Check out this article: https://vborg.vbsupport.ru/showthread.php?t=228078
The section relevant to you is: Save into an array and preregister to use in an existing/stock template
Santori
03-20-2011, 08:29 PM
Thank you very much!
I will read all!
--------------- Added 1300659430 at 1300659430 ---------------
I?m a little lost sorry..
This is my new post bit templates..
forumhome_forumbit2_level1_no post
forumhome_forumbit2_level1_post
forumhome_forumbit2_level2_no post
forumhome_forumbit2_level2_post
I want to use it in forumhome:
<!-- main -->
{vb:raw template_hook.forumhome_above_forums}
<ol id="forums" class="floatcontainer">
{vb:raw forumbits2}
</ol>
{vb:raw template_hook.forumhome_below_forums}
<!-- /main -->
Ok:
In this tutorial says I need to put into Forumhome Header that:
I don,t know how i can continue...
$templater = vB_Template::create('forumhome_forumbit2_level1_no post');
$templater->register('my var', $my_var);
$templater->register('my_array', $my_array);
$templatevalues['my_insertvar'] = $templater->render();
vB_Template::preRegister('FORUMHOME', $templatevalues);
BirdOPrey5
03-20-2011, 10:23 PM
That goes in a plugin, not the template.
In your Admin CP you go to Plugin Manager -> Add a New Plugin
You put the php code in the plugin, I believe the hook is either parse_template or forumhome_complete, the article should say- otherwise try both.
Santori
03-21-2011, 11:06 PM
Thank you, I resolved the problem!!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.