![]() |
How can I define a vb:raw?
Hello,
I have a custom page and it is currently using this "{vb:raw navbar}" to display the navbar. This is working properly. I have created a new navbar template called navbar2. When I use "{vb:raw navbar2}" it does not display. It has the same effect as if it were removed completely. How can I define/match navbar2 template with {vb:raw navbar2}. |
Why don't you just force your custom page to use a new skin with a modified navbar?
|
Variables need to be registered for use in templates. $navbar2 hasn't been registered, therefore there is no output. Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide
|
Thank you for the replies. My custom file has this at the bottom:
$templater = vB_Template::create('ncsu'); $templater->register_page_templates(); $templater->register('navbar', $navbar); $templater->register('navbar2', $navbar2); $templater->register('pagetitle', $pagetitle); print_output($templater->render()); And it is still not recognizing {vb:raw navbar2} |
And where is navbar2 defined relative to that code? You really need to post all your code along with templates and hook names, etc in order for us to see what is wrong.
|
Thank you so much for helping me out lynn. Here are all of the files im referring to:
navbar2 (template) in the Default Style Code:
<div id="navbar" class="navbar"> The {vb:raw navbar2} I want to display the navbar2 listed above Code:
{vb:stylevar htmldoctype} Notice I tried to register the navbar2 style but ultimately failed. Code:
<?php |
But you never did anything to create navbar2. You never define it or anything. You need to write some code to spit it all out into a variable called $navbar2.
|
Ahh okay, do I define it in the ncsu.php file? I looked and navbar has:
$navbar = render_navbar_template($navbits); so, I tried using $navbar2 = render_navbar2_template; but it didn't work :/ |
Did you try looking up that function? It's in the functions.php file. It renders the navbar template. If you want to render the template navbar2, you should probably copy that function, only call it something different, and render the navbar2 template.
|
Thanks for the response Lynn. In the functions.php file all I can find is:
Code:
$navbits = construct_navbits(array('' => $vbphrase['vbulletin_message'])); Code:
$navbits = $navbar = ''; Code:
function render_navbar_template($navbits) |
All times are GMT. The time now is 02:18 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:
|