vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Help - Getting Certain NavTabs Highlighted (https://vborg.vbsupport.ru/showthread.php?t=290149)

ARNK 11-04-2012 07:49 PM

Help - Getting Certain NavTabs Highlighted
 
1 Attachment(s)
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..

kh99 11-05-2012 10:56 AM

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.

Lynne 11-05-2012 02:34 PM

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

ARNK 11-05-2012 07:01 PM

Quote:

Originally Posted by kh99 (Post 2378540)
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 (Post 2378598)
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?

Lynne 11-05-2012 08:18 PM

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.

ARNK 11-05-2012 08:50 PM

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.

Lynne 11-06-2012 01:10 AM

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.

ARNK 11-06-2012 03:57 AM

Got it, thank you ^


All times are GMT. The time now is 03:23 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01745 seconds
  • Memory Usage 1,732KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete