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
  #62  
Old 01-06-2011, 06:43 AM
abdulbasitsaeed's Avatar
abdulbasitsaeed abdulbasitsaeed is offline
 
Join Date: Mar 2009
Posts: 182
Благодарил(а): 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
Thank you very much for this, Eric Anderson. It works perfectly on 4.0.6.

I must agree with NashChristian. I am unable to insert the arrow image in a satisfactory manner. Also, the margin on the right of the text seems to be more than on the left.

http://forums.pakfellows.com/

Lynne (or anyone else), do you think you could please help us out with this one?
Reply With Quote
  #63  
Old 01-17-2011, 02:33 PM
albanah albanah is offline
 
Join Date: Jan 2010
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ywwz View Post
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?
you cannot use Begin.

Use the following code and it will display BEFORE forum, immediately after Home tab

Quote:
global $template_hook;
$newTemplate = vB_Template::create('dropdown_newtab');
$template_hook['navtab_start'] .= $newTemplate->render();
Reply With Quote
  #64  
Old 04-08-2011, 07:01 PM
Da-Vinci Da-Vinci is offline
 
Join Date: Mar 2010
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can anybody point me in the right direction of how to do this?

Reply With Quote
  #65  
Old 04-23-2011, 12:53 PM
RobbieZ RobbieZ is offline
 
Join Date: Jul 2008
Posts: 1,117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Da-Vinci View Post
Can anybody point me in the right direction of how to do this?

UKBL created a quality dropdown menu system for 3.8 > https://vborg.vbsupport.ru/showthread.php?t=203521

I changed the code so sub-foums would appear by utilizing the same code for drop down, OK it was a lot of messing about and a lot of code, seriously wrecked my head at times but the end product was great!

I have never tried it on VB4 but I do have a few days off next week and may do this as a mini project on my test forum!

I would need a link to the skin your using in your OP.
Reply With Quote
  #66  
Old 04-23-2011, 07:34 PM
Da-Vinci Da-Vinci is offline
 
Join Date: Mar 2010
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow cheers Robbie, that would be great, I've got it on the default skin on my VB4 forum, the image above is something somebody else posted on page 1 I just used it to demonstrate the effect I was after.

I was looking at this

http://www.dynamicdrive.com/dynamici...menu/index.htm

As a possible way to get the submenu effect.

Edit:

I thought it might be better to post in the programming discussion forum to stop this article going off topic, so I've posted here. https://vborg.vbsupport.ru/showthread.php?p=2187926
Reply With Quote
  #67  
Old 04-25-2011, 09:18 PM
XiTCLUB XiTCLUB is offline
 
Join Date: Jan 2010
Location: Lahore, Pakistan
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great work
Reply With Quote
  #68  
Old 04-26-2011, 02:59 PM
Mustiii's Avatar
Mustiii Mustiii is offline
 
Join Date: Feb 2010
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have a question how must i modify the code to add dropdown items to the subnavbar as you can see on the picture?



Thanks for any help
Reply With Quote
  #69  
Old 04-27-2011, 09:12 AM
Da-Vinci Da-Vinci is offline
 
Join Date: Mar 2010
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mustiii View Post
I have a question how must i modify the code to add dropdown items to the subnavbar as you can see on the picture?



Thanks for any help
That's covered in this article.

https://vborg.vbsupport.ru/showthread.php?t=232579

Reply With Quote
  #70  
Old 04-29-2011, 07:54 PM
albanah albanah is offline
 
Join Date: Jan 2010
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

installed.
it works very well for 4.1.2
Many thanks
Reply With Quote
  #71  
Old 04-29-2011, 11:03 PM
BRotondi BRotondi is offline
 
Join Date: Sep 2008
Location: Zurich
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

1000 Thanks for the infos! How can I make the pull-down appear without click, simply when hovering?

Thanks!
Bruno
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:42 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
  • Page Generation 0.05552 seconds
  • Memory Usage 2,340KB
  • 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
  • (2)bbcode_code
  • (1)bbcode_php
  • (5)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
  • (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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete