PDA

View Full Version : breadcrumb issue after upgrading from vB3 to vB4


Psalmist
09-28-2012, 05:50 PM
We're upgrading a large forum from vBulletin 3 to vBulletin 4.

In our vBulletin 3 setup, the forum is the home page, on the root of our site. Basically our whole site is the forum.

vBulletin 4 has an articles section and by default that's the home page. We followed instructions to make the forum the homepage in our vBulletin 4 test setup. But two problems remain, both related to the breadcrumb navigation.

1. In vBulletin 3, the leftmost breadcrumb is the site name, not "Forum". We want to keep it that way (it should be the site title, not "Forum").

2. Also, in vBulletin 3, there is no breadcrumb on the homepage. We also want to keep that the same. (In our current test setup of vBulletin 4, there's an unlinked "Forum" breadcrumb on the main page.)

Can you please advise.

kh99
09-28-2012, 06:28 PM
1. In vBulletin 3, the leftmost breadcrumb is the site name, not "Forum". We want to keep it that way (it should be the site title, not "Forum").
That was a little tricky but there's a way to do it in a plugin using hook location template_register_var:

global $vbphrase, $vbulletin;

if ($this->template == 'navbar_link' AND $name == 'nav_title' AND $value == $vbphrase['forum'])
{
$value = $vbulletin->options['bbtitle'];
}



2. Also, in vBulletin 3, there is no breadcrumb on the homepage. We also want to keep that the same. (In our current test setup of vBulletin 4, there's an unlinked "Forum" breadcrumb on the main page.)

That one's a little easier: edit the navbar template, find the breadcrumb section and add an if, like:

<div class="body_wrapper">
<vb:if condition="THIS_SCRIPT != 'index'">
<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>
<hr />
</div>
</vb:if>