The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
[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'">
|
#42
|
|||
|
|||
Marketing tips my dear
|
#43
|
|||
|
|||
So I've been tinkering around with this tutorial and was close to raising the white flag of surrender because I could not understand this for the life of me.
So after long grueling hours, I've manage to figure things out and get things working...well sort of. I've used Lynne's artcle "[HOW TO - vB4] Create a own vBulletin page" and managed to create an about us page. My about us page named, "about.php" look like this... PHP Code:
My template page named, "aboutus_tmplt" looks like this... 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} <h2 class="blockhead">About Us blockhead text</h2> <div class="blockbody"> <div class="blockrow"> About Us text here </div> </div> {vb:raw footer} </body> </html> PHP Code:
It feels awesome when things just work! Like they say, "If it ain't broken, don't fix it", well that's not how it is in my case because my knowledge of VB's coding is fairly basic so I feel like I may have butchered some things that weren't necessary. What I'm concerned with is that I have no idea what this line of does in my plug-in code. PHP Code:
Can anyone shed some light as what that line of code does? Also what I'm hoping for is that if anyone can please verify that the lines of code I have posted are valid giving their respective names and all? Any help will greatly be appreciated. Thanks. |
#44
|
|||
|
|||
1. because your template is called aboutus_tmplt you need
PHP Code:
PHP Code:
|
#45
|
|||
|
|||
Hi,
I have added the template and plugin. But there is no letters appearing in the navbar. Can anyone help ? My template 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> Plugin if (THIS_SCRIPT == 'ragteknews') { //set selected tab $vbulletin->options['selectednavtab'] = 'ragteknews'; } // add the "subtemplate" to the navbartemplate $template_hook['navtab_middle'] .= vB_Template::create('ragtek_news_navbar')->render(); |
#46
|
|||
|
|||
@Chee Foo
You have to define "ragtek_news" as a new Phrase in the AdminCP. Then you will get the phrase you defined as the Tabname |
#47
|
|||
|
|||
You could also write "my phrase" instead of using a phrase
|
#48
|
|||
|
|||
Quote:
Phrase Type - Global ? Product - vBulletin ? Varname - ragtek_news ? Text - ?? |
#49
|
|||
|
|||
Phrase Type: Global
Varname: A varname, which you will have to use in the template Text: Yout text which will be shown in the template |
#50
|
|||
|
|||
Thanks!! It works!
|
#51
|
|||
|
|||
Works for me! Awesome, ty sir.
What about changing the order of the tabs... I see that in this example the tab is set to navtab_middle. If I wanted to switch this tab (now in position 2 out of 3) with the default 'what's new' tab (now in position 3 out of 3) would I state navtab_right ? TYTY |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|