![]() |
$threadid in navbar?
How can I work with $threadid in the navbar template?
|
You would have to preregister the variable for use in that template. Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide
|
Thanks! This is what worked for me:
On showthread.php replace PHP Code:
Code:
$templater = vB_Template::create('navbar'); |
Notice: For working with the $show variable array, you need to put the $navbar creation code in showthread.php after the $show variables are set.
|
Why don't you just preRegsiter the variable in the hook? No need to replace code in the php file.
Code:
vB_Template::preRegister('navbar', array('thread' => $thread)); |
Quote:
In this particular case I am happy to have it with the file edit as I have put the navbar template code below the part, where the $show variables are set. But I know, I may create the $show variables in a plugin, too. Just think that the 4.0.x releases are very few, so file edits are okay for me now :) |
File edits are a thing of the past and not necessary anymore. But to each his own.
|
Quote:
|
All times are GMT. The time now is 11:28 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|