Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-23-2011, 11:11 PM
Da-Vinci Da-Vinci is offline
 
Join Date: Mar 2010
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Icon navbar with dropdown menus and submenus

Hi all, first off I posted this template edit https://vborg.vbsupport.ru/showthread.php?t=262376

Basically this is the effect I've got up to now.



And here is the code I used.

HTML Code:
<!-- Navbar Icon Links -->
<div align="center">
<table class="body" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center" style="border-top-width:0px">
<tr align="center">
<td class="vbmenu_control">					
<li class="popupmenu"><a href="Catergory Link Goes Here"><center><img src="Image Link Goes Here" alt="Alt Description Goes Here"></center></a><p><center><a href="javascript://" class="popupctrl" accesskey="6"><b>Catergory Name Goes Here</b></center></p></a>
<ul class="popupbody popuphover">
{vb:raw template_hook.navbar_community_menu_start}
<li><a href="Link 1">Forum Name 1</a></li>
<li><a href="Link 2">Forum Name 2</a></li>
<li><a href="Link 3">Forum Name 3</a></li></td>
 
<td class="vbmenu_control">					
<li class="popupmenu"><a href="Catergory Link Goes Here"><center><img src="Image Link Goes Here" alt="Alt Description Goes Here"></center></a><p><center><a href="javascript://" class="popupctrl" accesskey="6"><b>Catergory Name Goes Here</b></center></p></a>
<ul class="popupbody popuphover">
{vb:raw template_hook.navbar_community_menu_start}
<li><a href="Link 1">Forum Name 1</a></li>
<li><a href="Link 2">Forum Name 2</a></li>
<li><a href="Link 3">Forum Name 3</a></li></td>

<td class="vbmenu_control">					
<li class="popupmenu"><a href="Catergory Link Goes Here"><center><img src="Image Link Goes Here" alt="Alt Description Goes Here"></center></a><p><center><a href="javascript://" class="popupctrl" accesskey="6"><b>Catergory Name Goes Here</b></center></p></a>
<ul class="popupbody popuphover">
{vb:raw template_hook.navbar_community_menu_start}
<li><a href="Link 1">Forum Name 1</a></li>
<li><a href="Link 2">Forum Name 2</a></li>
<li><a href="Link 3">Forum Name 3</a></li></td>

<td class="vbmenu_control">					
<li class="popupmenu"><a href="Catergory Link Goes Here"><center><img src="Image Link Goes Here" alt="Alt Description Goes Here"></center></a><p><center><a href="javascript://" class="popupctrl" accesskey="6"><b>Catergory Name Goes Here</b></center></p></a>
<ul class="popupbody popuphover">
{vb:raw template_hook.navbar_community_menu_start}
<li><a href="Link 1">Forum Name 1</a></li>
<li><a href="Link 2">Forum Name 2</a></li>
<li><a href="Link 3">Forum Name 3</a></li></td>

<td class="vbmenu_control">					
<li class="popupmenu"><a href="Catergory Link Goes Here"><center><img src="Image Link Goes Here" alt="Alt Description Goes Here"></center></a><p><center><a href="javascript://" class="popupctrl" accesskey="6"><b>Catergory Name Goes Here</b></center></p></a>
<ul class="popupbody popuphover">
{vb:raw template_hook.navbar_community_menu_start}
<li><a href="Link 1">Forum Name 1</a></li>
<li><a href="Link 2">Forum Name 2</a></li>
<li><a href="Link 3">Forum Name 3</a></li></td>

<td class="vbmenu_control">					
<li class="popupmenu"><a href="Catergory Link Goes Here"><center><img src="Image Link Goes Here" alt="Alt Description Goes Here"></center></a><p><center><a href="javascript://" class="popupctrl" accesskey="6"><b>Catergory Name Goes Here</b></center></p></a>
<ul class="popupbody popuphover">
{vb:raw template_hook.navbar_community_menu_start}
<li><a href="Link 1">Forum Name 1</a></li>
<li><a href="Link 2">Forum Name 2</a></li>
<li><a href="Link 3">Forum Name 3</a></li></td>

<td class="vbmenu_control">					
<li class="popupmenu"><a href="Catergory Link Goes Here"><center><img src="Image Link Goes Here" alt="Alt Description Goes Here"></center></a><p><center><a href="javascript://" class="popupctrl" accesskey="6"><b>Catergory Name Goes Here</b></center></p></a>
<ul class="popupbody popuphover">
{vb:raw template_hook.navbar_community_menu_start}
<li><a href="Link 1">Forum Name 1</a></li>
<li><a href="Link 2">Forum Name 2</a></li>
<li><a href="Link 3">Forum Name 3</a></li></td>

<td class="vbmenu_control">					
<li class="popupmenu"><a href="Catergory Link Goes Here"><center><img src="Image Link Goes Here" alt="Alt Description Goes Here"></center></a><p><center><a href="javascript://" class="popupctrl" accesskey="6"><b>Catergory Name Goes Here</b></center></p></a>
<ul class="popupbody popuphover">
{vb:raw template_hook.navbar_community_menu_start}
<li><a href="Link 1">Forum Name 1</a></li>
<li><a href="Link 2">Forum Name 2</a></li>
<li><a href="Link 3">Forum Name 3</a></li></td>

<td class="vbmenu_control">					
<li class="popupmenu"><a href="Catergory Link Goes Here"><center><img src="Image Link Goes Here" alt="Alt Description Goes Here"></center></a><p><center><a href="javascript://" class="popupctrl" accesskey="6"><b>Catergory Name Goes Here</b></center></p></a>
<ul class="popupbody popuphover">
{vb:raw template_hook.navbar_community_menu_start}
<li><a href="Link 1">Forum Name 1</a></li>
<li><a href="Link 2">Forum Name 2</a></li>
<li><a href="Link 3">Forum Name 3</a></li></td>

<td class="vbmenu_control">					
<li class="popupmenu"><a href="Catergory Link Goes Here"><center><img src="Image Link Goes Here" alt="Alt Description Goes Here"></center></a><p><center><a href="javascript://" class="popupctrl" accesskey="6"><b>Catergory Name Goes Here</b></center></p></a>
<ul class="popupbody popuphover">
{vb:raw template_hook.navbar_community_menu_start}
<li><a href="Link 1">Forum Name 1</a></li>
<li><a href="Link 2">Forum Name 2</a></li>
<li><a href="Link 3">Forum Name 3</a></li></td>

<td class="vbmenu_control">					
<li class="popupmenu"><a href="Catergory Link Goes Here"><center><img src="Image Link Goes Here" alt="Alt Description Goes Here"></center></a><p><center><a href="javascript://" class="popupctrl" accesskey="6"><b>Catergory Name Goes Here</b></center></p></a>
<ul class="popupbody popuphover">
{vb:raw template_hook.navbar_community_menu_start}
<li><a href="Link 1">Forum Name 1</a></li>
<li><a href="Link 2">Forum Name 2</a></li>
<li><a href="Link 3">Forum Name 3</a></li></td>
</tr>
</table>
</div>
<!-- / Navbar Icon Links -->
So I've got a couple things I'd like to do with this

The first problem is I'm using tables the old way and I really wanted to get this up to the XHTML standard. So after a bit of reading I added this to the additional.css template.

HTML Code:
/* ***** table for icon navbar with menus ***** */
.table
{
width:100%;
}
th
{
padding:20px;
}
With this code in the navbar template (I've left out the links and the Javascript stuff while I try to figure how to get the tables to work correctly)

HTML Code:
<!-- Navbar Icon Links With Menus-->

<div class="table" align="center">
<tr>
<th><img src="images/misc/home.png"></th>
<th><img src="images/misc/vip.png"></th>
<th><img src="images/misc/mp3.png"></th>
<th><img src="images/misc/mic.png"></th>
<th><img src="images/misc/euro.png"></th>
<th><img src="images/misc/tv.png"></th>
<th><img src="images/misc/console.png"></th>
<th><img src="images/misc/ebook.png"></th>
<th><img src="images/misc/mobile.png"></th>
<th><img src="images/misc/apple.png"></th>
<th><img src="images/misc/pc.png"></th>
</tr>
</div>

<!-- / Navbar Icon Links With Menus-->
Which never worked, so I tried adding it to the vbulletin.css template but that never worked either, I was hoping there would be a navbar.css template but no such luck, so where am I going wrong?

Currently with the above code in this is how it looks, compared to what I've already done.



The second problem is how to add submenus to the current dropdown menus, to look something like this.



I posted in this thread https://vborg.vbsupport.ru/showthrea...wpost&t=228338 as the code I've originally used has been pulled from the navbar template. RobbieZ has offered to help a little with this but I'd really like to learn the theory behind all this, I've learned loads in the past 18 months but feel like I'm just at the tip of the iceberg with coding as there are so many different languages to learn.

I've been looking at DHTML menus because Lynne kindly pointed me in that direction and I've also been reading up on Javascript but theirs that much info out there it's hard to know what is relevant to my needs.

I was looking at this http://www.dynamicdrive.com/dynamici...menu/index.htm but I've got to be honest the amount of CSS and Javascript is blowing my mind, I was hoping to replace some of the CSS classes such as body backgrounds and hover backgrounds with the VB stylevars, to make the menus universal for all skins, but like I say it's all going a bit over my head and I'm sure there must be a more simplistic way of going about it all.

Anyway thanks for reading, hopefully some of you kind people can share your knowledge and help out on this project of mine.
Attached Images
File Type: jpg icon navbar.jpg (20.7 KB, 0 views)
File Type: png Submenus.png (84.2 KB, 0 views)
Reply With Quote
  #2  
Old 04-28-2011, 10:06 AM
RobbieZ RobbieZ is offline
 
Join Date: Jul 2008
Posts: 1,117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Spending a few hours playing around with nav-tabs and nav-bar drop downs I concluded that without creating a new popupctrl and CSS submenu hover that submenus can not be done without this.

I then looked at dynamic drive's menu and followed the instructions, adding images like you did and changing some of the CSS colours I came up with this:

Reply With Quote
  #3  
Old 04-28-2011, 01:28 PM
Da-Vinci Da-Vinci is offline
 
Join Date: Mar 2010
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Robbie that is exactly what I was looking for could you share the code for this please?
Reply With Quote
  #4  
Old 04-29-2011, 07:09 AM
RobbieZ RobbieZ is offline
 
Join Date: Jul 2008
Posts: 1,117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, first off you need to download the zip from Dynamic Drive (your link) and follow the instructions then you will need to mess with the two css files in dreamweaver or similar program and change black to white etc..

Upload the folder to your root and place the code into your navbar after this:

Code:
{vb:raw ad_location.global_below_navbar}
The first link was home so I didnt use a drop down menu

The second link etc needed drop downs so you can see the code I have used here including the image reference and left the path as well.
Code:
rel="ddsubmenu(instert each number here and change accordingly)"
etc

Code:
<div id="ddtopmenubar" class="mattblackmenu">
<ul>
<li><a href="Catergory Link Goes Here"><img src="Image Ling Goes Here/ddlevelsfiles/home.png" alt="Home"></a></li>
<li><a href="Catergory Link Goes Here" rel="ddsubmenu1"><img src="Image Link Goes Here/ddlevelsfiles/vip.png"></a></li>
<li><a href="Catergory Link Goes Here" rel="ddsubmenu2"><img src="Image Link Goes Here/ddlevelsfiles/music.png"></a></li>
...
...
...
...
<li><a href="Catergory Link Goes Here" rel="ddsubmenu9"><img src="Image Link Goes Here/ddlevelsfiles/apple.png"></a></li>
</ul>
</div>

<script type="text/javascript">
ddlevelsmenu.setup("ddtopmenubar", "topbar") //ddlevelsmenu.setup("mainmenuid", "topbar")
</script>

<!--HTML for the Drop Down Menus associated with Top Menu Bar-->
<!--They should be inserted OUTSIDE any element other than the BODY tag itself-->
<!--A good location would be the end of the page (right above "</BODY>")-->

<!--Top Drop Down Menu 1 HTML-->
Now for each submenu create this afterwards and continue to list each submenu with a number for however many you use, ddsubmenu5, ddsubmenu6 etc.

A straight forward dropdown without subs would be this:

Code:
<ul id="ddsubmenu1" class="ddsubmenustyle">
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
</ul>
And a sub menu would be this:

Code:
<ul id="ddsubmenu2" class="ddsubmenustyle">
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a>
  <ul>
  <li><a href="#">Link 3.1b</a></li>
  <li><a href="#">Link 3.2b</a></li>
  <li><a href="#">Link 3.4b</a></li>
  </ul>
</li>
<li><a href="#">Link 4</a></li>
<li><a href="#">Link 5</a>
  <ul>
  <li><a href="#">Link 5.1b</a></li>
  <li><a href="#">Link 5.2b</a>
    <ul>
    <li><a href="#">Link 5.2.1b</a></li>
    <li><a href="#">Link 5.2.2b</a></li>
    <li><a href="#">Link 5.2.3b</a></li>
    </ul>
  </li>
	</ul>
</li>
<li><a href="#">Link 6</a></li>
</ul>
The code can have as many submenu as you wish as long as you encapsulate each sub in its own <ul> and close the sub with a </li> before moving to your next sub menu on your list.

Hope this helps..
Reply With Quote
  #5  
Old 04-30-2011, 09:14 PM
Da-Vinci Da-Vinci is offline
 
Join Date: Mar 2010
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Appreciate you efforts on this Robbie, but I was hoping to be able to use existing Stylevars, so the edit would blend effortlessly with any custom skin.

Sowhen editing the CSS files, rather than change Black to White, Black would be changed to {vb:stylevar navbar_popuplink_background} or whatever was appropriate for the element of the popup.
Reply With Quote
  #6  
Old 05-04-2011, 05:41 PM
Arthran Arthran is offline
 
Join Date: Apr 2011
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What I'm really looking for is the top navbar with multi level dropdown menu's like the ones you have from Dynamic Drive.
Reply With Quote
  #7  
Old 05-05-2011, 03:58 AM
Da-Vinci Da-Vinci is offline
 
Join Date: Mar 2010
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is what I have so far.



I'm still developing this and have various things to work out such as stylevars and aligning the UL element at 100% width, once I've got this part of the code perfected modifying it for the standard navbar shouldn't be too difficult.

If I had some help from a more experienced coder, particularly somebody with extensive knowledge of CSS, I'm sure I would reach the objective much quicker but I'm an amature at coding, so researching everything in my spare time is taking time, unfortunately you are going to have to wait until I've perfect everything, so far the only person to offer any help has been RobbieZ and without his help I doubt I would have got as far as I have with this.
Attached Images
File Type: jpg dropdown.jpg (48.4 KB, 0 views)
Reply With Quote
  #8  
Old 05-07-2011, 08:13 PM
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Location: Pensacola, FL
Posts: 772
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is exactly what I was looking for! Thank you so much for this!

This may make me hold off from switching to a different forum software. vbulletin's menu system requires too much edits. I wish they'd make it easier to create menus.
Reply With Quote
  #9  
Old 05-09-2011, 05:56 PM
Da-Vinci Da-Vinci is offline
 
Join Date: Mar 2010
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad you like it, I'm still working on the stylevars, so as to make compatible with all styles.

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

I've managed to sort this now, it's a complete re write of the code above, see the screenshot below.



One problem though is I still haven't managed to utilise the stylevars for the background, text or hover colours, so it does require manual edits to the CSS templates.
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 08:08 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.04695 seconds
  • Memory Usage 2,350KB
  • Queries Executed 14 (?)
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
  • (5)bbcode_code
  • (3)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (3)postbit_attachment
  • (9)postbit_onlinestatus
  • (9)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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete