Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 4 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[HOW TO - vB4] How to Add Drop Down Navigation Items to the Navbar
Shelby
Join Date: Nov 2005
Posts: 67

 

Show Printable Version Email this Page Subscription
Shelby Shelby is offline 11-18-2009, 10:00 PM

Some people really like the drop down navigation that is found in the Vbulletin 3.0 series, or are looking to add additional drop down navigation to the navbar in Vbulletin 4.0. This plugin and new template will allow you to do that.


First, is to goto the Plugins and Products section, this section is in the left hand column of the admin panel near the bottom. In that section you will need to click the option to "Add New Plugin". Note that the red text from both the plugin and template must be the same. You can name it whatever you want, but they must match.

For the new plugin you will enter the following details.
Hook Location: process_templates_complete
Title: Whatever You Want
Code:
Code:
global $template_hook;
$newTemplate = vB_Template::create('dropdown');
$template_hook['navtab_end'] .= $newTemplate->render();
For step two. You need to make the template that will be used in the navbar. Simply goto the style manager and in choose "Add New Template" from the options. From there, you just need to enter the following.
Title: dropdown
Code:
Code:
<li class="popupmenu">
<a href="javascript://" class="popupctrl navtab" style="background:transparent url({vb:stylevar imgdir_misc}/arrow.png) no-repeat {vb:stylevar right} center; padding-right: 15px">Drop Bombs</a>
<ul class="popupbody popuphover">
<li><a style="text-indent: 0px; color:{vb:stylevar navbar_selected_popup_body_a_Color}" href="sublink1.php">SubLink 1</a></li>
<li><a style="color:{vb:stylevar navbar_selected_popup_body_a_Color}" href="sublink2.php">SubLink 2</a></li>
<li><a style="color:{vb:stylevar navbar_selected_popup_body_a_Color}" href="sublink3.php">SubLink 3</a></li>
</ul>
</li>
Reply With Quote
  #22  
Old 12-14-2009, 10:00 AM
Pod Pod is offline
 
Join Date: Jun 2007
Posts: 129
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Eric Anderson View Post
I modified your code so the tab would highlight when hovered or clicked like the rest of the tabs. Unfortunately I had to lose the arrow. I attached a pic of the change and here is the code.

Template:
PHP Code:
<li class="popupmenu">
<
a href="javascript://" class="popupctrl navtab">Vmax4.com Pages</a>
<
ul class="popupbody popuphover">
<
li><a style="text-indent: 0px; color:{vb:stylevar navbar_selected_popup_body_a_Color}" href="sublink1.php">SubLink 1</a></li>
<
li><a style="color:{vb:stylevar navbar_selected_popup_body_a_Color}" href="sublink2.php">SubLink 2</a></li>
<
li><a style="color:{vb:stylevar navbar_selected_popup_body_a_Color}" href="sublink3.php">SubLink 3</a></li>
<
li><a style="color:{vb:stylevar navbar_selected_popup_body_a_Color}" href="sublink2.php">SubLink 2</a></li>
<
li><a style="color:{vb:stylevar navbar_selected_popup_body_a_Color}" href="sublink3.php">SubLink 3</a></li>
</
ul

You can try to add the arrow manually:
PHP Code:
<a href="javascript://" class="popupctrl navtab">Vmax4.com Pages <img src="{vb:stylevar imgdir_misc}/arrow.png" style="vertical-align: middle;" /></a

Also, to save "ink", you can put the color part of the style in the ul tag, instead of every a tag. It works for me, at least.
Reply With Quote
  #23  
Old 12-16-2009, 02:44 PM
nubian nubian is offline
 
Join Date: Nov 2004
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LOL @ drop bombs on your moms, that's awesome!
But why was the Shelby banned?
Reply With Quote
  #24  
Old 12-28-2009, 04:38 AM
ywwz ywwz is offline
 
Join Date: Jul 2009
Posts: 255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Substituting 'navtab_middle' for 'navtab_end' places it after the Forum tab and before the Blogs tab.============================

can i use Begin instead of middle or end?
Reply With Quote
  #25  
Old 12-28-2009, 02:25 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ywwz View Post
can i use Begin instead of middle or end?
You may use whichever template_hook you want in the navbar.
Reply With Quote
  #26  
Old 01-01-2010, 10:02 AM
stejoh stejoh is offline
 
Join Date: Jan 2007
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for great instructions.

Is there a way to keep the new Tab "highlighted" when reading a custom page.

I have created an About tab and when I choose a custom page from the dropdown-meny, the latest active "native" tab is still highlighted.

You can take a look at www.99nicu.org/forum
Attached Images
File Type: png Bild 6.png (38.6 KB, 0 views)
Reply With Quote
  #27  
Old 01-05-2010, 12:28 AM
TheSupportForum TheSupportForum is offline
 
Join Date: Jan 2007
Posts: 1,158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

does anyone know how to make this a clickable link

Code:
<li class="popupmenu">
<a href="javascript://" class="popupctrl navtab" style="background:transparent url(images/misc/arrow.png) no-repeat {vb:stylevar right} center; padding-right: 15px">Webmaster Links</a>
when you click it i want to be able to do to a page


i tried

Code:
<li class="popupmenu">
<a href="webmaster.php" class="popupctrl navtab" style="background:transparent url(images/misc/arrow.png) no-repeat {vb:stylevar right} center; padding-right: 15px">Webmaster Links</a>
doesnt work
Reply With Quote
  #28  
Old 01-05-2010, 11:52 PM
Front Range 4x4 Front Range 4x4 is offline
 
Join Date: Jan 2009
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you, very useful
Reply With Quote
  #29  
Old 01-07-2010, 04:51 AM
anilsaxena anilsaxena is offline
 
Join Date: Sep 2009
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This works great.
I noticed that user has to click first then only on hover it automatically shows drop-down. Is there a way to show drop-down without click?
Reply With Quote
  #30  
Old 01-07-2010, 09:33 AM
MooseMoney MooseMoney is offline
 
Join Date: Jan 2009
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

NOPE - does not work for me!

I have meticulously followed all the steps as per message No. 1. Nothing - no navbar buttons.
Neither can I find the plugin I created during step 2.
I have vB4 CMS suite installed - please help.
Reply With Quote
  #31  
Old 01-09-2010, 01:40 AM
businessmeet businessmeet is offline
 
Join Date: May 2009
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

EDIT: Nevermind!! I figured it out! Sorry! Just remove that "{vb:rawphrase faq}" stuff, with your own wording.

Maybe I overlooked something, but how do you adjust single link codes or rename them in the little navigation menu part? Like the "New Posts" "Private Messages" "FAQ" "Calendar" links? It seemed easier to do in version 3.8.4. Now in 4.0 it's:

Code:
<li><a rel="help" href="faq.php{vb:raw session.sessionurl_q}">{vb:rawphrase faq}</a></li>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:57 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05735 seconds
  • Memory Usage 2,346KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (13)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete