vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Calling custom templates in vB default templates (https://vborg.vbsupport.ru/showthread.php?t=233320)

bpat1434 01-17-2010 04:19 AM

Calling custom templates in vB default templates
 
I'm creating a product and have two template elements that I want to include. One is for thread creation, the other when displaying a thread. So I rightly named the templates:

newthread_my_module
showthread_my_module

Now they are visible in the admin template editor area. I have edited both "newthread" and "SHOWTHREAD" to try and inlcude my templates like so:

Code:

{vb:raw my_module}
I've also tried

Code:

{vb:raw newthread_my_module}
Either way, nothing seems to work. I can't quite look at the vB code and see exactly how the templates are associated. "threadmanagement" seems to link to the "newpost_threadmanage" template.

Can anyone shed some light on how I'm supposed to include my custom templates into a vB template?

bpat1434 01-22-2010 09:13 PM

I think I solved this on my own. I just added template hooks which need to be added to the theme(s).

Aadil 02-21-2010 03:27 AM

would u mind explaining how u did it? trying to do it myself

bpat1434 02-21-2010 11:11 AM

I created a template hook in my plugin, then called the appropriate hook in whatever template I wanted.

For example:

PHP Code:

$templater vB_template::create('my_template_name');
$templater->register('my_variable'$my_variable);
$template_hook['my_hook_name'] = $templater->render(); 

Then in the template, I just added the hook:

Code:

{vb:raw template_hook.my_hook_name}


All times are GMT. The time now is 10:16 AM.

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.01046 seconds
  • Memory Usage 1,715KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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