Okay I am struggling with this. I want to add a button on my navbar that links to a specific forum, and when a user is viewing that forum for the tab on the navbar to be highlighted.
So this is the information that I used:
template name: bb_navbar_events
template code:
HTML Code:
<vb:if condition="$vboptions['selectednavtab'] == 'navbarevents'">
<li class="selected">
<a class="navtab" href="forumdisplay.php?8-Events{vb:raw session.sessionurl_q}">{vb:rawphrase navbar_events}</a>
<ul class="floatcontainer">
<li><a href="#">#</a></li>
</ul>
</li>
<vb:else />
<li><a class="navtab" href="forumdisplay.php?8-Events{vb:raw session.sessionurl_q}">{vb:rawphrase navbar_events}</a></li>
</vb:if>
plugin code:
PHP Code:
if (THIS_SCRIPT == 'xxx') // also defined('navbarevents') possible
{
//set selected tab
$vbulletin->options['selectednavtab'] = 'navbarevents';
}
// add the "subtemplate" to the navbartemplate
$template_hook['navtab_middle'] .= vB_Template::create('bb_navbar_events')->render();
Should this arrangement be working properly?
I want the Events tab to be highlighted when it is on that page, but the Forum tab remains highlighted.
Any suggestions?