Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
  #1  
Old 06-15-2010, 07:32 AM
Webbstre Webbstre is offline
 
Join Date: Nov 2009
Posts: 175
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [Guide][Help Request]How to customize your menu into dropdown menus

Ok, I've been spending a while trying to figure this out, and while I am not a programmer by any means I have made progress and want to share it. Hopefully someone will be able to fill in the final pieces so that I can turn this into a complete guide for others.

Here is what I am trying to do:
  1. Drop all Tabs in the Navbar
  2. Replace the Tabs with dropdown menu tabs via the mod Tabs Add System for vBulletin 4 (sstab advanced)
  3. Preserve the sub-navbar menus when on the pages specific to the dropped

The Problem: Normally when you remove a tab from the navbar it completely removes the sub-navbar, even when on the pages. Most people recommend removing the tabs by disabling a plug-in, or by using a different modification (such as one that removes the Home, Forum, Blog, or What's New tabs), but those tend to remove the sub-navbars as well.

For example, let's say you are using DownloadsII. If you want to remove the tab, you can go into your plug-ins list and disable "DownloadsII: Add a Downloads tab." If you do this, and then go to your downloads page, it no longer displays anything in the sub-navbar.


Here is what I have done so far:
  1. Edited the Tab Add System's plug-in so that instead of linking the new drop-down menu tabs to navtab_start, navtab_middle, and navtab_end, it instead inserts menus into navtab2_start, navtab2_middle, and navtab2_end. (notice the 2 in the new name)
  2. Edited the navbar template so that it now has the following hooks right next to the original counterparts: {vb:raw template_hook.navtab2_start}, {vb:raw template_hook.navtab2_middle}, and {vb:raw template_hook.navtab2_end}
  3. Enclosed the original hooks within the following code:
    Code:
    <div style="display:none"></div>
    in order to hide the original menus.

After that it starts to get tricky. The dropdown menus are the only menus that load, which is half of the effect that I wanted to achieve. The problem here is that the sub-navbars do not load. I have added the removed tabs' links into the new dropdown menus via the modification's Admin CP area, so the links are all there to the original pages, but enclosed within the dropdown menus.

I discovered that after the {vb:raw template_hook.navtab_start} hook, as well as the others, there is a line of code that looks like this:
Code:
<vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT != 'search'">
I have come to the conclusion that this is what I need to edit to reproduce the sub-navbar. I tried changing that line of code (after the first hook) to this:
Code:
<vb:if condition="THIS_SCRIPT != 'search'">
The end result was that the forum's sub-navbar menu now loads everywhere. I fixed the code, but I have come to the following conclusions:
  1. That line of code needs to be edited to only go into effect when on the page appropriate to what is currently loaded
  2. I suspect that a related line of code must exist within the various modifications that may need to be modified as well, or instead of the code mentioned above.


With all of that said, is there anyone out there with the code understanding to tell me what I am missing at the end of all of this? I feel like I'm so close to reaching my goal.
Reply With Quote
  #2  
Old 06-17-2010, 01:51 AM
Webbstre Webbstre is offline
 
Join Date: Nov 2009
Posts: 175
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe I have the option to bump this every day or two, so I'm going do so and hope someone can help me finish this. If I can get the last part figured out then people will be able to do a lot more menu customization.
Reply With Quote
  #3  
Old 06-17-2010, 05:49 AM
ChopSuey ChopSuey is offline
 
Join Date: Jun 2009
Location: Alaska
Posts: 2,140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe that you should ask in the modification(s) thread.
Reply With Quote
  #4  
Old 06-17-2010, 06:08 AM
Webbstre Webbstre is offline
 
Join Date: Nov 2009
Posts: 175
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, as this is asking for help with a template/code edit, and not how to edit or use that modification, I posted it here. It also doesn't help that the author of the modification thread (who can probably answer my question since he managed it with part of his modification for) hasn't been seen in a month and that his English isn't very good either.
Reply With Quote
  #5  
Old 06-17-2010, 09:37 AM
ChopSuey ChopSuey is offline
 
Join Date: Jun 2009
Location: Alaska
Posts: 2,140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm sorry i will look over the mod and your post.
Reply With Quote
  #6  
Old 06-17-2010, 10:37 AM
Webbstre Webbstre is offline
 
Join Date: Nov 2009
Posts: 175
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem. Questions asked are questions answered... or so I hope :P

I tried fiddling around with the if conditional more earlier, but it leads me to believe my conclusions may be off. I don't know enough about code to understand how the mod author achieved it with his mod, although I can find the parts that must be relevant. For example, searching for "blog" in the xml product file leads to various code that somehow makes it so the blog button can be removed, without disabling the sub-navbar. If I could just understanding how it does what it does in that code I could answer my own question X_X
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 07:48 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.05099 seconds
  • Memory Usage 2,213KB
  • 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
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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