vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How to call another forumbits templates (https://vborg.vbsupport.ru/showthread.php?t=260671)

Santori 03-19-2011 11:38 PM

How to call another forumbits templates
 
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 [DATE]1300659430[/DATE] at [TIME]1300659430[/TIME] ---------------

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!!


All times are GMT. The time now is 05:38 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00974 seconds
  • Memory Usage 1,718KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete