Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 04-17-2006, 01:25 PM
In need In need is offline
 
Join Date: Jul 2005
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Navbar, dropdown menu!

Hi,

I was wondering if it's possible to make one of the options I have on my navbar menu, to drop down? It's default for Search and Quick Links, is it possible to do the same for others? If so, how?

Kind regards,

Mr. Need.
Reply With Quote
  #2  
Old 04-18-2006, 01:28 AM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sure. The navbar template is the best place to look at the popup menu routines. Such as the Quick Links link below:

Code:
		<if condition="$show['popups']">
			<if condition="$show['member']">
				<td id="usercptools" class="vbmenu_control"><a href="$show[nojs_link]#usercptools">$vbphrase[quick_links]</a> <script type="text/javascript"> vbmenu_register("usercptools"); </script></td>		
			</if>
                          </if>
The key is the "ID". In the above code you'll find twice "usercptools". That is how you identify your popup menu. So, let's say you want to create a new popup menu called "In_need" you'd do this:

Code:
		<if condition="$show['popups']">
				<td id="In_need" class="vbmenu_control"><a href="$show[nojs_link]#In_need">$vbphrase[quick_links]</a> <script type="text/javascript"> vbmenu_register("In_need"); </script></td>		
                          </if>


To make it work you'll need to add in the popup bits. It's better to place this code at the bottom of the template. For the navbar template look for:

Code:
<!-- NAVBAR POPUP MENUS -->
Below that add:

Code:
	<!-- In_need popup menu -->
	<div class="vbmenu_popup" id="In_need_menu" style="display:none">
		<table cellpadding="4" cellspacing="1" border="0">
		<tr><td class="thead">Menu Header Here...</td></tr>
		<tr><td class="vbmenu_option"><a href="link_URL_here">Link 1 here...</a></td></tr>
		<tr><td class="vbmenu_option"><a href="link_URL_here">Link 2 here...</a></td></tr>
		<tr><td class="vbmenu_option"><a href="link_URL_here">Link 3 here...</a></td></tr>
                          </table>
             </div>
	<!-- / In_need popup menu -->
The "ID" is case sensitive so notice that I've used your name which has a capital "I". Try this code out. Of course you'll need to add in the variables (e.g., URL, Link names).
Reply With Quote
  #3  
Old 04-18-2006, 03:51 PM
In need In need is offline
 
Join Date: Jul 2005
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, It looks ok, but when I click on it, nothing comes down? The menu does not come down. I've added all the links and link names in, and the ID is also the same on both pages. Any ideas?
Reply With Quote
  #4  
Old 04-18-2006, 07:27 PM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm. This:

Code:
		<if condition="$show['popups']">
				<td id="In_need" class="vbmenu_control"><a href="$show[nojs_link]#In_need">$vbphrase[quick_links]</a> <script type="text/javascript"> vbmenu_register("In_need"); </script></td>		
                          </if>
Should have been this:
Code:
		<if condition="$show['popups']">
				<td id="In_need" class="vbmenu_control"><a href="$show[nojs_link]#In_need">In_need's Menu</a> <script type="text/javascript"> vbmenu_register("In_need"); </script></td>		
                          </if>
Though, that has nothing to do with your problem. I just rephrased "Quick Links" to "In_need's Menu".

Now, going back to your question I cut and pasted the exact codes in my navbar template and it worked. When you say "both pages" where exactly did you place the codes? For troubleshooting, can you please provide the templates and codes that you used.
Reply With Quote
  #5  
Old 04-18-2006, 09:26 PM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahh. For it to work properly both codes need to be in the same template. Since your link is in the Header template remove your code in the navbar template. Then at the bottom of your Header template after:

Code:
<!-- /logo -->
Add
Code:
<if condition="$show['popups']">
<!-- Audio popup menu -->
	<div class="vbmenu_popup" id="Audio" style="display:none">
		<table cellpadding="4" cellspacing="1" border="0">
		<tr><td class="thead">Page</td></tr>
		<tr><td class="vbmenu_option"><a href="http://www.uponsunnah.com/lectures.php">Lectures</a></td></tr>
		<tr><td class="vbmenu_option"><a href="http://www.uponsunnah.com/quran.php">Qur'an</a></td></tr>
		<tr><td class="vbmenu_option"><a href="http://www.uponsunnah.com/arabic.php">Learn Arabic</a></td></tr>
                          </table>
             </div>
<!-- / Audio popup menu -->
</if>

BTW...If the links you are calling are within your domain, not an external domain, I suggest removing the "http://www.uponsunnah.com". It's just added server resources when you loop internal links.
Reply With Quote
  #6  
Old 04-18-2006, 10:30 PM
In need In need is offline
 
Join Date: Jul 2005
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I put the code there, it still doesn't work It appears on the forum, but when I click on it, nothing drops down.

I don't see why it shouldn't work with the navbar template, the search and quicklinks does?
Reply With Quote
  #7  
Old 04-18-2006, 11:46 PM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ooops. We forgot the "_menu". So...

Replace:
Code:
<if condition="$show['popups']">
<!-- Audio popup menu -->
	<div class="vbmenu_popup" id="Audio" style="display:none">
		<table cellpadding="4" cellspacing="1" border="0">
		<tr><td class="thead">Page</td></tr>
		<tr><td class="vbmenu_option"><a href="http://www.uponsunnah.com/lectures.php">Lectures</a></td></tr>
		<tr><td class="vbmenu_option"><a href="http://www.uponsunnah.com/quran.php">Qur'an</a></td></tr>
		<tr><td class="vbmenu_option"><a href="http://www.uponsunnah.com/arabic.php">Learn Arabic</a></td></tr>
                          </table>
             </div>
<!-- / Audio popup menu -->
</if>
With
Code:
<if condition="$show['popups']">
<!-- Audio popup menu -->
	<div class="vbmenu_popup" id="Audio_menu" style="display:none">
		<table cellpadding="4" cellspacing="1" border="0">
		<tr><td class="thead">Page</td></tr>
		<tr><td class="vbmenu_option"><a href="http://www.uponsunnah.com/lectures.php">Lectures</a></td></tr>
		<tr><td class="vbmenu_option"><a href="http://www.uponsunnah.com/quran.php">Qur'an</a></td></tr>
		<tr><td class="vbmenu_option"><a href="http://www.uponsunnah.com/arabic.php">Learn Arabic</a></td></tr>
                          </table>
             </div>
<!-- / Audio popup menu -->
</if>
Reply With Quote
  #8  
Old 04-19-2006, 08:29 AM
In need In need is offline
 
Join Date: Jul 2005
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

:banana: It works! Thank you!
Reply With Quote
  #9  
Old 04-19-2006, 09:47 PM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad you got it working.
Reply With Quote
  #10  
Old 04-22-2006, 10:03 PM
dwbro1's Avatar
dwbro1 dwbro1 is offline
 
Join Date: Apr 2006
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok I'm doing something wrong here and cannot find it can you please help. It is adding the Gallery button and drop down. I'm going to add a few of these drop downs one for gallery one for links and a misc one. I know I need to add the IF statement for show popups and I will if I can get this working. I just plan on adding the IF / ELSE and either show the button with the down arrow or a gallery button that links directly to the gallery main page. I'm assuming this would be right.


Code:
<!-- set below for skin width-->
<table width="753" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" align="left" valign="top">

<div id="brd_outer">
<div id="brd_in">


<!-- begin iSkin header / logo is controlled via #logo in main CSS file -->

<div id="hdr_bdr">
<div id="hdr"><div id="logo"></div></div>
<div id="hdr_btm"></div>
</div>
<div id="nav_back">
	<table width="339" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
	<td width="43" height="29"><a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1"><img id="nav_home" src="$stylevar[imgdir_misc]/nav_home.gif" width="43" height="29" border="0" alt="" /></a></td>
	
	
	<td width="67" height="29"><a href="usercp.php$session[sessionurl_q]"><img id="nav_cp" src="$stylevar[imgdir_misc]/nav_cp.gif" width="67" height="29" border="0" alt="" /></a></td>
		<if condition="$show['registerbutton']">
<td width="67" height="29"><a href="register.php$session[sessionurl_q]" rel="nofollow"><img id="nav_reg" src="$stylevar[imgdir_misc]/nav_reg.gif" width="67" height="29" border="0" alt="" /></a></td>
<else />	
	
	
	

<td width="70" height="29" id="usercptools"><a href="$show[nojs_link]#usercptools"><img id="nav_menu" src="$stylevar[imgdir_misc]/nav_forums.gif" width="69" height="29" border="0" alt="" /></a><script type="text/javascript"> vbmenu_register("usercptools", 1); </script></td>
		</if>	
<!-- Gallery Button -->
<td width="76" height="29" id="gallery_menu"><a href="$show[nojs_link]#gallery"><img id="nav_menu" src="$stylevar[imgdir_misc]/nav_gallery.gif" width="75" height="29" border="0" alt="" /></a> <script type="text/javascript"> vbmenu_register("gallery"); </script></td>		
<!-- / Gallery button -->

	<td width="67" height="29"><a href="memberlist.php$session[sessionurl_q]"><img id="nav_members" src="$stylevar[imgdir_misc]/nav_members.gif" width="67" height="29" border="0" alt="" /></a></td>
		<td width="69" height="29"><a href="../gallery/index.php$session[sessionurl_q]"><img id="nav_cal" src="$stylevar[imgdir_misc]/nav_gallery.gif" width="68" height="29" border="0" alt="" /></a></td>
		<td width="50" height="29"><a href="../links/index.php"><img id="nav_cal" src="$stylevar[imgdir_misc]/nav_links.gif" width="49" height="29" border="0" alt="" /></a></td>
		<td width="75" height="29"><a href="calendar.php$session[sessionurl_q]"><img id="nav_cal" src="$stylevar[imgdir_misc]/nav_cal.gif" width="75" height="29" border="0" alt="" /></a></td>
		<td width="59" height="29"  id="navbar_search"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow"><img id="nav_search" src="$stylevar[imgdir_misc]/nav_search.gif" width="59" height="29" border="0" alt="" /></a><script type="text/javascript"> vbmenu_register("navbar_search", 1); </script></td>
		<td width="35" height="29"><a href="faq.php$session[sessionurl_q]" accesskey="5"><img id="nav_faq" src="$stylevar[imgdir_misc]/nav_faq.gif" width="35" height="29" border="0" alt="" /></a></td>
		<td width="2" height="29"><img id="nav_rs" src="$stylevar[imgdir_misc]/nav_rs.gif" width="2" height="29" alt="" /></td>
		</tr>
	</table>
</div>

<if condition="$show['popups']">
<!-- NAVBAR POPUP MENUS -->
	
	<if condition="$show['searchbuttons']">
	<!-- header quick search form -->
	<div class="vbmenu_popup" id="navbar_search_menu" style="display:none">
		<table cellpadding="4" cellspacing="1" border="0">
		<tr>
			<td class="thead">$vbphrase[search_forums]</td>
		</tr>
		<tr>
			<td class="vbmenu_option" title="nohilite">
			<form action="search.php" method="post">
				<input type="hidden" name="do" value="process" />
				<input type="hidden" name="showposts" value="0" />
				<input type="hidden" name="quicksearch" value="1" />
				<input type="hidden" name="s" value="$session[sessionhash]" />
				<input type="text" class="bginput" name="query" size="20" />&nbsp;$gobutton<br />
			</form>
			</td>
		</tr>
		<tr>
			<td class="vbmenu_option"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[advanced_search]:</a></td>
		</tr>		
		<tr>
<td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]:</a></td>
</tr>	
		<tr>
				<td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]:</a></td>
		</tr>		
		</table>
	</div>
	<!-- / header quick search form -->
	</if>

	<if condition="$show['member']">
	<!-- user cp tools menu -->
	<div class="vbmenu_popup" id="usercptools_menu" style="display:none">
		<table cellpadding="4" cellspacing="1" border="0">
		
		<tr><td class="thead">$vbphrase[quick_links]</td></tr>	<!-- Added Option -->
<tr><td class="vbmenu_option"><a href="forum_index.php">Forums Home</a></td></tr>
<!-- End Added Option -->	
		<if condition="$vboptions['enablesearches']"><tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily">$vbphrase[todays_posts]</a></td></tr></if>
		<tr><td class="vbmenu_option"><a href="forumdisplay.php?$session[sessionurl]do=markread">$vbphrase[mark_forums_read]</a></td></tr>
		<tr><td class="vbmenu_option"><a href="#" onclick="window.open('misc.php?$session[sessionurl]do=buddylist&amp;focus=1','buddylist','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=250,height=300'); return false;">$vbphrase[open_buddy_list]</a></td></tr>
				
		<tr><td class="thead"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_control_panel]</a></td></tr>
		<if condition="$show['siglink']"><tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editsignature">$vbphrase[edit_signature]</a></td></tr></if>
		<!--<if condition="$show['avatarlink']"><tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editavatar">$vbphrase[edit_avatar]</a></td></tr></if>-->
		<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editprofile">$vbphrase[edit_profile]</a></td></tr>
		<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editoptions">$vbphrase[edit_options]</a></td></tr>
		
		<tr><td class="thead">$vbphrase[miscellaneous]</td></tr>
		<if condition="$show['pmstats']"><tr><td class="vbmenu_option"><a href="private.php$session[sessionurl_q]" rel="nofollow">$vbphrase[private_messages]</a></td></tr></if>
		<tr><td class="vbmenu_option"><a href="subscription.php$session[sessionurl_q]" rel="nofollow">$vbphrase[subscribed_threads]</a></td></tr>
		<tr><td class="vbmenu_option"><a href="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[my_profile]</a></td></tr>
		<if condition="$show['wollink']"><tr><td class="vbmenu_option"><a href="online.php$session[sessionurl_q]">$vbphrase[whos_online]</a></td></tr></if>
		
		</table>
	</div>
	<!-- / user cp tools menu -->
	</if>
<!-- / NAVBAR POPUP MENUS -->

<!-- PAGENAV POPUP -->

	<div class="vbmenu_popup" id="pagenav_menu" style="display:none">
		<table cellpadding="4" cellspacing="1" border="0">
		<tr>
			<td class="thead" nowrap="nowrap">$vbphrase[go_to_page]</td>
		</tr>
		<tr>
			<td class="vbmenu_option" title="nohilite">
			<form action="$vboptions[forumhome].php" method="get" onsubmit="return this.gotopage()" id="pagenav_form">
				<input type="text" class="bginput" id="pagenav_itxt" style="font-size:11px" size="4" />
				<input type="button" class="button" id="pagenav_ibtn" value="$vbphrase[go]" />
			</form>
			</td>
		</tr>
		</table>
	</div>

<!-- / PAGENAV POPUP -->
</if>
<!-- Gallery Button -->
<!-- PAGENAV GALLERY -->

	<div class="vbmenu_popup" id="gallery_menu" style="display:none">
		<table cellpadding="4" cellspacing="1" border="0">
		<tr><td class="thead">Page</td></tr>
		<tr><td class="vbmenu_option"><a href="">1</a></td></tr>
		<tr><td class="vbmenu_option"><a href="">2</a></td></tr>
		<tr><td class="vbmenu_option"><a href="">3</a></td></tr>
                          </table>
             </div>


<!-- / PAGENAV GALLERY -->
<!-- /  Gallery Button -->
<!-- content table -->
<table bgcolor="#FFFFFF" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>



$spacer_open

$_phpinclude_output
$welcomeheaders
Ok I think I got it .. Will post corrected one once I'm sure.. I still have a question about the accesskey="" field though. I only see one of those in the default template. What exactly are they used for?
Reply With Quote
Reply

Thread Tools
Display Modes

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 01:31 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.09220 seconds
  • Memory Usage 2,298KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (11)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete