The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
Which hook location does that plugin use?
|
#3
|
|||
|
|||
The hook is: set_navigation_tab_vbview
Thanks! |
#4
|
|||
|
|||
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. |
#5
|
|||
|
|||
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 |
#6
|
|||
|
|||
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. |
#7
|
|||
|
|||
Excellent! That works a treat - thanks very much!
|
#8
|
|||
|
|||
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 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|