[HOW TO - vB4] Create a New Tab in the navbar (with template)
1 Attachment(s)
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'"> PHP Code:
Thats important because where using a condition in the template: HTML Code:
<vb:if condition="$vboptions['selectednavtab'] == 'ragteknews'"> |
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! |
Sorry, strange that it's gone away. I've edited my post;)
And the hook is process_templates_complete |
Quote:
|
1 Attachment(s)
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! |
whats your code?
|
Which code? The plugin code?
|
Plugin and template code
|
Very cool and simple, thanks for this.
|
Plug In Code:
Code:
$tabselected = ''; Code:
{vb:stylevar htmldoctype} |
Is your templace called "member_ranks" or something else?
|
Its called vbcms_ranks
Please tell me its not that simple.......I knew it would be something simple I was over looking... |
Perfect! I didn't want to have to edit the files especially since its in beta.
|
Quote:
I think you made it completely false |
vbcms_navbar_add
Code:
<vb:if condition="$vboptions['selectednavtab'] == 'Ranks'"> |
Try this:
PHP Code:
|
1 Attachment(s)
That didnt work.........
but it did add a light gray line at the top of the page.... |
Hi ragtek, thanks for the code, will use it later =)
Right now I'm trying to do something a little differente: create a tertiary navbar just below the sections navbar for the CMS page. In this tertiary navbar wil be listed the subsections for the sections in the navbar. So if there's a section named "Music" in the navbar, when clicked, the tertiary navbar wil show the subsections from "Music". It's almost the same as the Section Navigation Widget, but in the navbar and without all that java =) Is this possible, and, how? =) Thank you =) |
Quote:
sorry |
please post "news.php" content, because i cant find how to make a selectednavtab, did what you have said, but it still doesnt work!
|
Hi,
https://vborg.vbsupport.ru/showthread.php?t=228112 A test.php page I've created here New tab is not selected TEST My bad English For test.php please tell me? Regards |
Quote:
|
Like this https://vborg.vbsupport.ru/attachmen...8&d=1258596456
I click new tab TEST test.php page opens But Forum tab will be selected |
Quote:
Quote:
|
Sorry, this may very obvious, but why is there a condition?
I would want the tab to be visible whether I am viewing the CMS, Blog or forum. EDIT: As it is always with me, I understand it a little more after posting a questions and rereading the original post. Is the condition for when the link is selected, do some action, like go to that link? EDIT2: How do I put a name on the tab? Do I create a phrase? Is there anything wrong with me replacing {vb:rawphrase ragtek_news} with my tab name? |
The condition is for when that tab is 'active' and the submenu shows.
|
Quote:
I'm just looking to add a tab when clicked goes to another page. |
Quote:
|
Could someone show this noob how for example I could create 2 tabs each linking to an url? I don't understand what exactly I need to do.
|
any word on my issues? post #17 and the forum tab selected instead of the "Ranks" page???
|
Quote:
would be great if you add a sample of your test.php, because ive searched everywhere and didnt come accross with it |
Quote:
PHP Code:
template: PHP Code:
PHP Code:
|
Quote:
Now okay Regards |
Thanks, this is what i needed.
define(ragteknews, true); you must include this in your how-to |
i've updated the article
|
Still tinkering around with this. Is it possible to define the selectednavtab for a CMS page to use with this method? For example if my news.php page was part of the CMS such as http://www.mydomain.com/content.php?5-news where would I define define(news, true); ?
Code:
<vb:if condition="$vboptions['selectednavtab'] == 'news'"> |
Quote:
i wish this would be possible with vB4 ( http://www.vbulletin.com/forum/showt...07#post1852507 )^^ |
Your template works like a charm for my non-CMS pages - thanks for that! I will have to leave News down in the submenu bar for now and hope that they improve the ability to manage the navbar in upcoming releases.
|
1 Attachment(s)
Fantastic! Thank you for sharing. It was the only missing to finish microSUPPORT for vB4. Works like a charm and I don't have wrong highlight problems.
Maria |
Quote:
haven't you wrote that you've finished with the vB Community and don't want to code anything else?[/ot] |
All times are GMT. The time now is 08:47 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|