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
  #52  
Old 08-13-2010, 10:46 PM
eues eues is offline
 
Join Date: Apr 2010
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by simonhind View Post
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
I would like to know this too please!!
Reply With Quote
  #53  
Old 08-25-2010, 07:22 PM
tech4c tech4c is offline
 
Join Date: Jan 2009
Location: New Zealand
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks
Reply With Quote
  #54  
Old 09-13-2010, 07:07 AM
NashChristian's Avatar
NashChristian NashChristian is offline
 
Join Date: Jul 2007
Location: Nashville, TN
Posts: 292
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

THIS is Eric's Original Objective & Problem:
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.
This response does NOT make sense to me, because it does NOT maintain Eric's Objective:
Quote:
Originally Posted by mabersoft View Post
PHP 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">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
Try this. This has arrow.
YES, the arrow works, but the tab is NOT highlight when hovered or clicked like the rest of the tabs (which was the whole point).

Finally, this approach PARTIALLY works:
Quote:
Originally Posted by Pod View Post
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
The problem is that this arrow does NOT change color along with the text color. In other words, it remains white even when the tab color is white (or near white), and is then invisible.

Am I doing something wrong or does ANYONE have a solution to this?

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

Quote:
Originally Posted by reefland View Post
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.
Love to hear a reply on this conflict!

Anyone?

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

Quote:
Originally Posted by anilsaxena View Post
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?
Love to hear an answer to this issue too!

Anyone?

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

Quote:
Originally Posted by ukwoman View Post
How do I do the same thing but with no subnav? For example I just want to show calendar on the main Nav bar.
Finally, an answer to this would be VERY helpful. I'd like to be able to use a different customized subnav for each of my primary pages (forums, blogs, groups...).

This mod would be tremendously useful if we could get these minor issues addressed.

Thanks for the mod and for any help!
Jeff

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

I've started a new thread HERE for anyone who wants to follow or participate in the development of the modifications above.
Reply With Quote
  #55  
Old 09-16-2010, 08:02 PM
Parture Parture is offline
 
Join Date: Aug 2005
Posts: 237
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For my drop down box how do I get the hover color to be the same as the normal tabs?

See here...
http://biblocality.com/forums/forum.php
Reply With Quote
  #56  
Old 09-23-2010, 10:00 PM
Parture Parture is offline
 
Join Date: Aug 2005
Posts: 237
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone figure out how to get the hover color to change at the same time keeping the arrow and getting the arrow to change color as well?

See what the problem is here...
http://biblocality.com/forums/forum.php
Reply With Quote
  #57  
Old 09-29-2010, 01:00 AM
Parture Parture is offline
 
Join Date: Aug 2005
Posts: 237
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As a result of changing colors in style variables, my drop down boxes span the whole screen. Something went haywire with this plugin.

Actually I don't know this is the cause. All I know is that the drop down boxes span the whole screen in IE and the username is bolden and larger when using IE, but with Firefox it is still the same. This just happened when I was playing with the style variable settings.
Reply With Quote
  #58  
Old 01-01-2011, 11:36 AM
merk_aus merk_aus is offline
 
Join Date: Feb 2008
Location: Australia
Posts: 582
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can someone please help me find out what i need to do to get this to appear at the beginning of the navbar before the home/forum tabs.
Reply With Quote
  #59  
Old 01-01-2011, 04:09 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 merk_aus View Post
Can someone please help me find out what i need to do to get this to appear at the beginning of the navbar before the home/forum tabs.
You need to look at the navbar template and pick a template_hook that is at the beginning of the navtab bar - the example in the first post used the template_hook at the end of the navtab bar. You may also need to change the execution order for the plugin if you have two plugins trying to use the same template_hook.
Reply With Quote
  #60  
Old 01-02-2011, 04:03 AM
merk_aus merk_aus is offline
 
Join Date: Feb 2008
Location: Australia
Posts: 582
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
You need to look at the navbar template and pick a template_hook that is at the beginning of the navtab bar - the example in the first post used the template_hook at the end of the navtab bar. You may also need to change the execution order for the plugin if you have two plugins trying to use the same template_hook.
Thanks lynne you are a true asset to this website.
Reply With Quote
  #61  
Old 01-04-2011, 12:53 PM
Sarcoth Sarcoth is offline
 
Join Date: Mar 2006
Location: Huntsville
Posts: 521
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to control the execution order from outside the plugin? I have the following setting in my product script:

<setting varname="showroster_navbar_order" displayorder="20">
<datatype>posint</datatype>
<validationcode><![CDATA[return ($data >= 1);]]></validationcode>
<defaultvalue>5</defaultvalue>
</setting>

I cannot find anything that would allow me to adjust the order like the location (navtab_start, navtab_middle, and navtab_end). Those work fine, it is the ordering I cannot get to work. Any ideas?

Edited: Sorry, this probably is not the correct place to ask. I've asked the question in a coder's forum instead. Thank you.
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 02:34 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.04715 seconds
  • Memory Usage 2,357KB
  • 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
  • (2)bbcode_php
  • (9)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