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
  #42  
Old 03-05-2010, 05:01 AM
sulasno sulasno is offline
 
Join Date: Feb 2010
Posts: 588
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

post deleted

never mind; I got it working

thanks to the original contributor
Reply With Quote
  #43  
Old 03-21-2010, 06:14 AM
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Location: almelo
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

did someone managed to do sub - sub menu's on the navbar like in post 13
i realy need that.
Reply With Quote
  #44  
Old 05-19-2010, 06:23 PM
AfterWorldForum AfterWorldForum is offline
 
Join Date: Dec 2008
Posts: 154
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great article.

Any way to get the template cached, though? I have debub mode turned on, and this template is the only one that seems to be not cached.

Thanks.

Peter.

--------------- Added [DATE]1274379546[/DATE] at [TIME]1274379546[/TIME] ---------------

Hmm. I also have the problem with the navbar background not changing color when highlighted. Removing the style stuff works, but then the arrow icon dissappears.

Using IE8, but also no luck in FF.

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"><img src="images/entropiaplanets/process.png" border="0" align="top" alt="EntropiaPlanets Tools" />&nbsp;&nbsp;EP Tools</a>
<ul class="popupbody popuphover">
		<li><a style="text-indent: 0px; color:{vb:stylevar navbar_selected_popup_body_a_Color}" href="business.php">Yellow pages</a></li>
		<li><a style="color:{vb:stylevar navbar_selected_popup_body_a_Color}" href="http://www.entropiaplanets.com/forums/vbay.php">Auction</a></li>
		<li><a style="color:{vb:stylevar navbar_selected_popup_body_a_Color}" href="http://www.entropiaplanets.com/forums/misc.php?do=cchatbox">Chat</a></li>
		<li><a style="color:{vb:stylevar navbar_selected_popup_body_a_Color}" href="http://www.entropiaplanets.com/forums/vbugs.php">Bug tracker</a></li>
		<li><a style="color:{vb:stylevar navbar_selected_popup_body_a_Color}" href="http://www.entropiaplanets.com/forums/missions.php">Mission tracker</a></li>
</ul>
</li>
Reply With Quote
  #45  
Old 05-24-2010, 07:07 AM
AfterWorldForum AfterWorldForum is offline
 
Join Date: Dec 2008
Posts: 154
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Found out how to get the caching working. I created a new plugin, linked it to the hook cache_templates, and used the following code to cache the template:

Code:
$cache = array_merge($cache, array('<template_name>'));
Reply With Quote
  #46  
Old 06-01-2010, 04:31 PM
AfterWorldForum AfterWorldForum is offline
 
Join Date: Dec 2008
Posts: 154
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone got a working solution for the non-changing background colour by any chance? I have not yet managed to get that bit working.
Reply With Quote
  #47  
Old 06-13-2010, 02:06 AM
merk_aus merk_aus is offline
 
Join Date: Feb 2008
Location: Australia
Posts: 582
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks worked brilliantly straight out of the box - have bookmarked it to add additional functionality to our site in the coming days this is absolutely brilliant.
Reply With Quote
  #48  
Old 06-20-2010, 10:08 AM
mordor1 mordor1 is offline
 
Join Date: Apr 2010
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great tutorial works fine even in 4.04
Reply With Quote
  #49  
Old 06-24-2010, 06:37 PM
wpeloquin wpeloquin is offline
 
Join Date: May 2006
Location: Behind you...
Posts: 143
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any way to make the default "Forum" navtab a dropdown, instead of adding a new tab?

I run a gaming board that hosts multiple games, guilds/clans, etc. I wish to make the Forum navtab a dropdown that i can then have the links to the various areas on the board. I followed this tutorial to create a plugin/template to help show what i am looking to do.

I figure i could remove the default "Forum" tab and replace it with the new one, but i was wondering if it can just be done on the current, default tab.
Attached Images
File Type: png forum_dropbox_navtab.png (179.4 KB, 0 views)
Reply With Quote
  #50  
Old 07-15-2010, 12:19 AM
Steph H Steph H is offline
 
Join Date: Jun 2007
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you! After a little trial and error, I got this to work wonderfully on our site. I appreciate the help!
Reply With Quote
  #51  
Old 08-05-2010, 09:27 PM
reefland reefland is offline
 
Join Date: Jan 2002
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynn or anyone,

Any ideas how to make this menu stay on top of a .swf file? I have a .swf advert in ad_below_navbar and the dropdown menu slides behind the advert.

Ideas welcomed.
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 09:32 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.06588 seconds
  • Memory Usage 2,330KB
  • 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
  • (4)bbcode_code
  • (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