The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Wont let me add to template var {vb:raw notifications_menubits}'s value in a plugin
{vb:raw notifications_menubits} is a variable in the header template. I am making a plugin and require adding additional content to this variable (it's the one that *should* stick content where I have drawn this red line ). I created a plugin and have tried both global_start and parse_template as hooks but the following never displays anything when I load my forum index:
Code:
$variabletest = 'llllllllllllllllll'; vB_Template::preRegister('header',array('notifications_menubits' => $variabletest)); |
#2
|
|||
|
|||
I don't know if this is the only problem (or if it's just a typo) but you need a '$' before variabletest in the preRegister call, like:
Code:
vB_Template::preRegister('header',array('notifications_menubits' => $variabletest)); |
#3
|
|||
|
|||
Thanks for spotting that, yeah it was just a typo. The problem still persists
|
#4
|
||||
|
||||
Why not add directly to the $notifications array using the notifications_list hook location?
|
#5
|
|||
|
|||
It seems your problem is that the notification menu is built and the header template rendered without any hooks in between, so no matter which hook location you choose you can't get in between them to change it. The only thing I can figure out (and I've never actually tried this) is to use hook location template_render_output and something like:
Code:
if ($this->template == 'header') { // code to change $notification_menubits } Seems like it should work, I've just never tired it. Also, of course, if all else fails you can always just edit the vb files. ETA: Or you could try what Lynne suggests above (which she posted while I was writing), but I looked at that and it looks like it would have to correspond to a userfield with a value > 0, and you'd end up with a number following your text. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|