The Arcive of vBulletin Modifications Site. |
|
|
[HOW TO - vB4] Create a New Tab in the navbar (with template)
I know that lynne allready postet an article, but here's a other way: This tutorial will show you, how to add own links to your navbar. (In the tutorial i'll use the code for my news add-on) 1. create a template (ragtek_news_navbar) HTML Code:
<vb:if condition="$vboptions['selectednavtab'] == 'ragteknews'"> <li class="selected"> <a class="navtab" href="news.php{vb:raw session.sessionurl_q}">{vb:rawphrase ragtek_news}</a> <ul class="floatcontainer"> <li><a href="#">#</a></li> </ul> </li> <vb:else /> <li><a class="navtab" href="news.php{vb:raw session.sessionurl_q}">{vb:rawphrase ragtek_news}</a></li> </vb:if> PHP Code:
Thats important because where using a condition in the template: HTML Code:
<vb:if condition="$vboptions['selectednavtab'] == 'ragteknews'">
|
|
#2
|
|||
|
|||
|
Can I ask where do you place the plugin?
In truth I am getting a bit lost with this, why can't the CMS simply place links where you want them, I like subdreamer's way of doing this I think! |
|
#3
|
|||
|
|||
|
Sorry, strange that it's gone away. I've edited my post
![]() And the hook is process_templates_complete |
|
#4
|
|||
|
|||
|
Quote:
|
|
#5
|
|||
|
|||
|
Man this is awesome. When I am displaying the page I created the forums tab is still highlighted....am I missing something or did I forget to change something.....
Thanks for the help! |
|
#6
|
|||
|
|||
|
whats your code?
|
|
#7
|
|||
|
|||
|
Which code? The plugin code?
|
|
#8
|
|||
|
|||
|
Plugin and template code
|
|
#9
|
||||
|
||||
|
Very cool and simple, thanks for this.
|
|
#10
|
|||
|
|||
|
Plug In Code:
Code:
$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'member_ranks')
{
$vbulletin->options['Ranks']='unique_name';
$tabselected = ' class="selected"';
}
$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="ranks.php">Ranks</a>'.$tablinks.'</li>' ;
Code:
{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
<head>
<title>{vb:raw vboptions.bbtitle}</title>
{vb:raw headinclude}
</head>
<body>
{vb:raw header}
{vb:raw navbar}
<div id="pagetitle">
<h1>{vb:raw pagetitle}</h1>
</div>
<h2 class="blockhead">=MK= Member Ranks</h2>
<div class="blockbody">
<div class="blockrow">
<div>
MY CUSTOM CODE WENT HERE ( Removed to save some space)
</div>
</div>
</div>
</div>
{vb:raw footer}
</body>
</html>
|
![]() |
|
|