vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Brain freeze on vB_Template::preRegister (https://vborg.vbsupport.ru/showthread.php?t=323945)

ctrenks 11-29-2016 03:04 AM

Brain freeze on vB_Template::preRegister
 
I have a custom template cportal, this is simple a head and footer template, and i use a php script to fill in between the lines fro outside forum pages. In the php file i have a meta section that i add meta data such as OG: and twiter card info.

I then have it al saved as $mymeta, then i run this

vB_Template::preRegister('headinclude', array('mymeta' => $mymeta));

inside the top of the headinclude template i have

{vb:raw mymeta}

this is not displaying any of the data though?

I have spent a couple of hours looking at this, somthing I thought I had working all along but not so.

Dragonsys 11-29-2016 12:16 PM

if you are trying to inject the data into your cportal template, then you need to add the vb:raw to that template, and change your Register to cportal instead of headinclude.

Code:

vB_Template::preRegister('cportal',array('mymeta' => $mymeta));
You also need to make sure you call out the templates in your PHP file.

Code:

$globaltemplates = array(
        'cportal',
)


ctrenks 11-29-2016 01:32 PM

Thank you for the reply, it was after all working but somehow my variable was being over written, something new to track down!


All times are GMT. The time now is 01:12 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.00881 seconds
  • Memory Usage 1,708KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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