Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 28 Jun 2014, 16:42
Twilkey's Avatar
Twilkey Twilkey is offline
 
Join Date: Oct 2006
Issue pre-registering variable for header

I have created a product and in that product everything works right. The only issue I am having is pre-registering a variable for my header template.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Everything here works except the vB_Template:reRegister. The variable does get populated. I can see the data if I dump it.

I have tried many different plugin hook locations. I have tried the globals, the forumdisplays, I also tried parse_templates, but nothing seems to work, and it seems to just be with pre-registering for header, because I changed it to navbar and it worked, so I am a bit confused.
Reply With Quote
  #2  
Old 28 Jun 2014, 16:47
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Try using hook parse_templates, and make sure you have a "global" declaration for any global variables you use.
Reply With Quote
  #3  
Old 28 Jun 2014, 18:13
Twilkey's Avatar
Twilkey Twilkey is offline
 
Join Date: Oct 2006
Originally Posted by kh99 View Post
Try using hook parse_templates, and make sure you have a "global" declaration for any global variables you use.
As I said before, I tried parse_templates. As for globals, what globals are you talking about? The only thing in that code that doesnt work is the preRegister to the header.
Reply With Quote
  #4  
Old 28 Jun 2014, 19:53
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by Twilkey View Post
As I said before, I tried parse_templates. As for globals, what globals are you talking about? The only thing in that code that doesnt work is the preRegister to the header.
OK, all I can tell you is that parse_templates should work as the hook (in fact, I don't think there's any other hook that is guaranteed to work in every situation). Did you dump $twbr_bits right before the preRegister call while using hook parse_templates?

ETA: also, did you double check to make sure you spelled twbr_bits right in the template? I know these seem obvious, but if you're sure the variable is being set then I don't see any reason it shouldn't work.

Anyway, maybe someone else will have an idea.

Last edited by kh99; 28 Jun 2014 at 21:39.
Reply With Quote
  #5  
Old 29 Jun 2014, 01:44
Twilkey's Avatar
Twilkey Twilkey is offline
 
Join Date: Oct 2006
Thanks for your help, It seems you were right, I needed to global $foruminfo. I think the problem was that when I dumped it was in the forumdisplay hooks, so I didnt need to global the variable, but when I changed to parse_templates, I needed to.

Again, thank you.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 15:25.

Layout Options | Width: Wide Color: