View Full Version : move code from navbar to header
helmica
09-29-2011, 11:44 AM
hi all,
I have tried to move the following code from navbar to header;
Code:
<div id="breadcrumb" class="breadcrumb">
<ul class="floatcontainer">
<li class="navbithome"><a href="index.php{vb:raw session.sessionurl_q}" accesskey="1"><img src="{vb:stylevar imgdir_misc}/navbit-home.png" alt="{vb:rawphrase home}" /></a></li>
{vb:raw navbits.breadcrumb}
{vb:raw navbits.lastelement}
</ul>
</div>
When the code is executed from navbar my Breadcrumb is showing in front end as expected. When i move the code from navbar to the header section it will just show the "house" before the breadcrumblinks and no links is showing.
Is it possible to move the code, and if so, what am i doing wrong?
Best regards,
saad
It's not working because you would need to register the navbits variable to the header template. You could try making a plugin with this code:
global $navbits;
$navbits = array();
vB_Template::preRegister('header', array('navbits' => $navbits));
but there's also the issue of when the header template is rendered. Normally it wouldn't happen until another template was rendered, which I think means that this method could work. But I think it's also possible that a plugin could cause a template to be rendered earlier in which case this wouldn't work.
helmica
09-29-2011, 01:59 PM
hi kh99,
thanks for your reply
i use new template not the default template
i try your code and not working
please continue help me
regards
helmica
nhawk
09-29-2011, 03:21 PM
You can move the breadcrumb anywhere on the page you want without editing the header or navbar templates.
Go to ACP->Styles & Templates->Style Manager.
For your template, select Edit Templates. Then go to CSS Templates and select vbulletin-chrome.css
Locate this code in the template..
/*************************************************/
/* BREADCRUMB */
.breadcrumb > ul {
background:transparent url({vb:stylevar imgdir_misc}/navbit-home.png) {vb:stylevar left} top no-repeat;
border:none;
}
And replace with this..
/*************************************************/
/* BREADCRUMB */
.breadcrumb > ul {
background:transparent url({vb:stylevar imgdir_misc}/navbit-home.png) {vb:stylevar left} top no-repeat;
border:none;
position:absolute;
top:60px;
left:450px;
}
On the standard vB template, that will place the Breadcrumb on the same line as the navtabs next to the What's New button.
You can adjust it's position by changing the top and left values to put it anywhere on the page you want.
EDIT: For some custom templates, you may need to find the breadcrumb in additional.css.
helmica
10-03-2011, 06:23 AM
hi nhawk,
thanks for you reply
i replace the code with code that you provide and nothing occur
please continue help me
thanks in advance for your help
regards
helmica
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.