Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 11-04-2012, 08:49 PM
ARNK ARNK is offline
 
Join Date: Oct 2012
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help - Getting Certain NavTabs Highlighted

Ok, I'll try to explain the best I can - just a newb. Because you can't create new template pages in the CMS, I'm having to create new articles and link to them as if they're actual pages.

1. So, I create a new article. For example, "About"
2. Go the the Navigation Manager, and select Add Tab, name it About.. link it to the Article

Now when I click on About, of course the NavTab highlighted is Articles (or in the screenshot, "Home"). Bottom line: All I need is to have About highlighted when it's selected, and Home deselected.

Is this possible?

From reading on here there's something about creating a plugin hook, but I don't follow.

The THIS_SCRIPT variable for the newly created article just says: var THIS_SCRIPT = "vbcms";

When I plug-in vbcms in the Tab Script(s) area it doesn't do anything as you'd expect.

Appreciate any hints to get me pointed in the right direction..
Attached Images
File Type: jpg screenshot3.jpg (92.7 KB, 0 views)
Reply With Quote
  #2  
Old 11-05-2012, 11:56 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What might work well for you is to set "Append 'tabid' to URL" to yes. Normally that would be (IMHO) a last resort for getting a tab to be selected because it will only appear selected if you arrive on the page by clicking the tab, but in your case it sounds like there isn't any other way you'd expect people to get to the page.
Reply With Quote
  #3  
Old 11-05-2012, 03:34 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hook location: set_navigation_tab_vbview
php:
PHP Code:
if (intval($_GET['r']) == xx$root 'tab_this_yyy'
Change xx to the article id (shown in URL) and tab_this_yyy to the tabid shown in the navigation manager.

Plugin system - http://www.vbulletin.com/docs/html/plugin_system
Reply With Quote
  #4  
Old 11-05-2012, 08:01 PM
ARNK ARNK is offline
 
Join Date: Oct 2012
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
What might work well for you is to set "Append 'tabid' to URL" to yes. Normally that would be (IMHO) a last resort for getting a tab to be selected because it will only appear selected if you arrive on the page by clicking the tab, but in your case it sounds like there isn't any other way you'd expect people to get to the page.
Thank you, huh.. I guess it's a temporary solution until I can figure out the other way. Appreciate that..

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

Quote:
Originally Posted by Lynne View Post
hook location: set_navigation_tab_vbview
php:
PHP Code:
if (intval($_GET['r']) == xx$root 'tab_this_yyy'
Change xx to the article id (shown in URL) and tab_this_yyy to the tabid shown in the navigation manager.

Plugin system - http://www.vbulletin.com/docs/html/plugin_system
I assume I just drop that code right into set_navigation_tab_vbview? I can do this for multiple links right?
Reply With Quote
  #5  
Old 11-05-2012, 09:18 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, you don't just drop that code in the plugin, you need to make the couple of changes I listed for the tab first. And yes, you may list several of those in that plugin.
Reply With Quote
  #6  
Old 11-05-2012, 09:50 PM
ARNK ARNK is offline
 
Join Date: Oct 2012
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So the ID is 74 and the tab is tab_mja2_349. Seems pretty straight forward but I'm missing something Lynne.

So, the code is: if (intval($_GET['r']) == 74) $root = 'tab_this_349';

I just go to create New Plugin. Then find the hook location... plugin the code and set it to active right? But this doesn't work. I'll try to find that section in the manual... but appreciate your help so far.
Reply With Quote
  #7  
Old 11-06-2012, 02:10 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, it is not tab_this_349 - it should be something like tab_otux_996 or tab_mtkz_287 - only tab_ will be the same.
Reply With Quote
  #8  
Old 11-06-2012, 04:57 AM
ARNK ARNK is offline
 
Join Date: Oct 2012
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Got it, thank you ^
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 02:30 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.04468 seconds
  • Memory Usage 2,252KB
  • 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
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (1)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)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