Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 03-10-2013, 07:35 PM
anolian anolian is offline
 
Join Date: Jun 2011
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default selecting tabs without appending tabid to url

Hi

I'm trying to find a way to make sure that tabs I create in the Navigation Manager, that have CMS sections as their Target, are visible selected after being clicked.

I know that setting Append 'tabid' to URL will do this - but I don't like adding a URL parameter for this for several reasons.

VBulletin support have helped me with a plugin that selects the right tab, using this syntax:

if (intval($_GET['r']) == sectionId) $root = 'tab_identity';

This works fine - except that now the submenus for my tabs (which previously showed links to any subsections in the current section) have disappeared.

vBulletin support say I should ask here for a way to:

"modify the plugin code to have all the submenu items be selected also"

So can anyone tell me how to do that please?

Thanks very much, Mike
Reply With Quote
  #2  
Old 03-10-2013, 07:51 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Which hook location does that plugin use?
Reply With Quote
  #3  
Old 03-10-2013, 08:13 PM
anolian anolian is offline
 
Join Date: Jun 2011
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The hook is: set_navigation_tab_vbview

Thanks!
Reply With Quote
  #4  
Old 03-10-2013, 08:33 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm...I'm afraid I don't understand the problem. I have (in my test forum) a section called "News" with sectionid 5. So I created a new tab called "News" with url "content.php?r=5-News" and Append tabid set to No, and I created two links under it. Then I created a plugin on hook set_navigation_tab_vbview with this code:
Code:
if (intval($_GET['r']) == 5)
   $root = 'tab_mzmz_532';

And it seems to work OK. If I select the tab, it goes to the news section, the tab is selected, and my two links are displayed. Are we talking about the same things? The way it works normally, there won't be any submenus or links shown unless you've defined them for that tab. Maybe that's what the problem is?

ETA: what *doesn't* work is if I go to the News section using the Section widget and not the tab, then the default CMS tab is selected.
Reply With Quote
  #5  
Old 03-10-2013, 09:40 PM
anolian anolian is offline
 
Join Date: Jun 2011
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi

The original problem is that without the plugin the wrong tab is selected - but when I am on a tab which has a CMS section as its target, I can see the links to other subsections in the same section (as deinfed in the section manager) in the subnav.

With the plugin, the correct tab is selected, BUT the links to other subsections in the same section disappear.

Does that make it clearer? Can post screenshots if not.

I could add each of the subsections as a link in each of hte new tabs - but that seems to be overkill if vB can display them without me doing that.

Thanks, Mike
Reply With Quote
  #6  
Old 03-10-2013, 09:50 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, I see. Well, try this: create another plugin using hook navigation_tab_complete and this code:
Code:
if (defined('CMS_SCRIPT') AND $tabdata[$tabid]['name'] == 'tab_identity')
{
	$tabdata[$tabid]['children'] = vBCms_NavBar::getLinks();
}

and of course you'd replace tab_identity with the actual tab id.
Reply With Quote
  #7  
Old 03-11-2013, 08:35 PM
anolian anolian is offline
 
Join Date: Jun 2011
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent! That works a treat - thanks very much!
Reply With Quote
  #8  
Old 03-17-2013, 05:44 PM
anolian anolian is offline
 
Join Date: Jun 2011
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi again

I have a new problem related to this one.

I can select a tab when the corresponding section is requested. However, when I follow a link to a page within that section the section tab is no longer selected.

So is there a way to identify the section to which any content item belongs so that I can ensure the corresponding tab is also selected?

Thanks very much, Mike
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 12:06 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.06777 seconds
  • Memory Usage 2,218KB
  • Queries Executed 11 (?)
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_code
  • (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
  • (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_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