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

Reply
 
Thread Tools
How To Add Drop Down Menus To Your Navbar
peterska2
Join Date: Oct 2003
Posts: 6,504

 

Manchester, UK
Show Printable Version Email this Page Subscription
peterska2 peterska2 is offline 07-29-2006, 10:00 PM

I think everyone has encountered the situation at some point or other where their navbar has got very cluttered and they are faced with either adding yet another navbar, or adding some dropdown menus to group some items.

This tutorial explains how to create an additional drop down menu in your navbar.

Firstly, locate in your navbar template the first instace of
Code:
<if condition="$show['popups']">
and add after it
Code:
<td id="custommenu" class="vbmenu_control">
    <a href="#">Custom Menu</a>
    <script type="text/javascript">
        vbmenu_register("custommenu");
    </script>
</td>
Replace Custom Menu with the title for this menu which you want displayed on your navbar and custommenu with the name that you want to give your link. Note that spaces are not to be used as this will break the connection with the actual menu.

Next, in your navbar template find
Code:
<!-- NAVBAR POPUP MENUS -->
and add after it
Code:
<div class="vbmenu_popup" id="custommenu_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
        <tr>
            <td class="thead">Custom Menu</td>
        </tr>
        <tr>
            <td class="vbmenu_option" title="nohilite">
content row
</td>
</tr>
</table>
</div>
Again replace custommenu with the name given to your link. Make sure that you leave the _menu after it as this identifies it as the menu part of the link. Also replace Custom Menu again with the title that you have used for your link.

The content row should be replaced with the actual menu item that you want to have in your new drop down menu.

Repeat the code
Code:
<tr>
            <td class="vbmenu_option" title="nohilite">
content row
</td>
</tr>
as required to add additional links onto your menu.

If you wish to break your menu into sections like the quicklinks use then add
Code:
<tr>
            <td class="thead">Custom Menu</td>
        </tr>
everywhere that you wish to add a new header.

The content added should be in the normal html format for links.



If you wish to add more than one menu, repeat the process for each one, ensuring that you use a different name for each menu otherwise they will not function correctly.


I hope you find this useful.
Reply With Quote
  #162  
Old 09-16-2009, 04:17 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 slobra View Post
Ok, sorry for bumping this thread and I feel kinda stupid asking for help because it shouldn't be very hard. I've followed the instructions to a T, read all the replies here, and still no luck - I can't get anything to show up! Website is http://truestreetcars.com using 3.8.2. Any help is appreciated. Current navbar template:
You never added it to your navbar. You only did the second part of the instructions (the dropdown part).
Reply With Quote
  #163  
Old 09-16-2009, 05:17 PM
slobra slobra is offline
 
Join Date: Jul 2008
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
You never added it to your navbar. You only did the second part of the instructions (the dropdown part).
Oh. Duh. Sorry to bother you. Thanks for kickstarting my brain!
Reply With Quote
  #164  
Old 09-24-2009, 03:25 AM
GoTTi GoTTi is offline
 
Join Date: Jun 2002
Posts: 1,346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i cant get this to work in 3.8.4....do the instructions on the first post work in 3.8.4?
Reply With Quote
  #165  
Old 09-24-2009, 03:29 AM
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 GoTTi View Post
i cant get this to work in 3.8.4....do the instructions on the first post work in 3.8.4?
Yes. But, if you are using a custom style, you may have to change things slightly due to changes between the default style and your custom style.
Reply With Quote
  #166  
Old 10-27-2009, 02:49 PM
steeler7 steeler7 is offline
 
Join Date: Oct 2009
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've tried to get this work and no luck. It hasn't showed up in the nav bar for me. For a quick instance it showed up next to my log in information, but that disappeared.

Here's my code. As far as I can see for Step 1 I found the correct.

Here's my code broken up with the bolded parts being what I had added in. If the entire code is needed, let me know. I figured this would might be easy to determine if and where I messed up

Code:
<if condition="$show['notifications']">
			<div><span id="notifications"><a href="usercp.php$session[sessionurl_q]">$vbphrase[your_notifications]:</a> <strong>$notifications_total</strong></span></div>
			<if condition="$show['popups']">
<td id="links" class="vbmenu_control">
    <a href="http://www.pittsburghsportstavern.com/cmps_index.php?pageid=steelersaffiliates">Links</a>
    <script type="text/javascript">
        vbmenu_register("links");
    </script>
</td>

				<script type="text/javascript"> vBmenu.register("notifications"); </script>
			<else />
				<script type="text/javascript"

Code:
<if condition="$show['popups']">
<!-- NAVBAR POPUP MENUS -->

<div class="vbmenu_popup" id="links_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
        <tr>
            <td class="thead">Links</td>
        </tr>
<tr>
            <td class="thead">Steelers Links</td>
        </tr>
        <tr>
            <td class="vbmenu_option" title="nohilite">
<a href="http://www.pittsburghsportstavern.com/cmps_index.php?pageid=steelersaffiliates">Steelers Affiates</a>
</td>
</tr>
<tr>
            <td class="vbmenu_option" title="nohilite">
<a href="http://www.pittsburghsportstavern.com/cmps_index.php?pageid=steelersnewslinks">Steelers News Sites</a>
</td>
</tr>
            <td class="vbmenu_option" title="nohilite">
<a href="http://www.pittsburghsportstavern.com/cmps_index.php?pageid=nflsites">NFL News And Info</a>
</td>
</tr>
<tr>
            <td class="thead">Penguins Links</td>
        </tr>
            <td class="vbmenu_option" title="nohilite">
<a href="http://www.pittsburghsportstavern.com/cmps_index.php?pageid=penstavernaffiliates">Pens Affiliates</a>
</td>
</tr>
            <td class="vbmenu_option" title="nohilite">
<a href="http://www.pittsburghsportstavern.com/cmps_index.php?pageid=pensnewssites">Pens News Sites</a>
</td>
</tr>
            <td class="vbmenu_option" title="nohilite">
<a href="http://www.pittsburghsportstavern.com/cmps_index.php?pageid=nhlnews">NHL News And Info</a>
</td>
</tr>
<tr>
            <td class="thead">Piarates Links</td>
        </tr>
            <td class="vbmenu_option" title="nohilite">
<a href="http://www.pittsburghsportstavern.com/cmps_index.php?pageid=piratesfriends">Pirates Affiliates</a>
</td>
</tr>
            <td class="vbmenu_option" title="nohilite">
<a href="http://www.pittsburghsportstavern.com/cmps_index.php?pageid=piratesnews">Pirates News Sites</a>
</td>
</tr>
            <td class="vbmenu_option" title="nohilite">
<a href="http://www.pittsburghsportstavern.com/cmps_index.php?pageid=mlbnews">MLB News And Info</a>
</td>
</tr>
</table>
</div>
	<if condition="$show['communitylink']">
	<!-- community link menu -->
Reply With Quote
  #167  
Old 10-27-2009, 03:34 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You are adding the code into your navbar where the Notifications are supposed to go. You need to add it amongst the other navbar links.
Reply With Quote
  #168  
Old 10-27-2009, 05:12 PM
steeler7 steeler7 is offline
 
Join Date: Oct 2009
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah... Thank you. I had been wondering why I wasn't putting any code where the Nav Buttons are. I guess for 3.8 it would be the 2nd instance of
Code:
<if condition=$show['popups']">
One mroe quick question... I don't want the "nohilite" feature. Do I just delete >>title="nohilite"<<?
Reply With Quote
  #169  
Old 10-27-2009, 05:16 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 steeler7 View Post
One mroe quick question... I don't want the "nohilite" feature. Do I just delete >>title="nohilite"<<?
Try it and see. (Sorry, I've always left that there, so I don't know what happens if you remove it.)
Reply With Quote
  #170  
Old 11-09-2009, 01:03 PM
Karm4 Karm4 is offline
 
Join Date: Jun 2008
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will this work with
PHP Code:
<if>
<if 
condition="is_member_of($bbuserinfo, 5, 6, 7)"
I want to make sure the menu is only shown to those usergroups. It works right now with a direct link but now i need more menus underneath it.
Reply With Quote
  #171  
Old 11-09-2009, 03:46 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know why you have that extra <if>. This should work:
PHP Code:
<if condition="is_member_of($bbuserinfo, 5, 6, 7)">  
stuff only to be seen by members of usergorup 5,6,7
</if> 
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 05:39 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.06330 seconds
  • Memory Usage 2,338KB
  • 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
  • (9)bbcode_code
  • (2)bbcode_php
  • (4)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
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • 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