PDA

View Full Version : Dealing with Navigation Manager


RisingGlow
08-19-2014, 09:04 PM
I recently decided it was time to upgrade vBulletin to the latest v4.
The biggest issue here is the navbar and it's tabs.

What I used to have it as before was the forum home page would show the tabs Forum, Blogs, and other plugins' tab like vBshop. However, I had a custom page where if you were on it, it wouldn't show Blogs or vBshop tabs. It would show other tabs that I assigned it to show ONLY on that specific page via THIS_SCRIPT. This is still possible for me because I'm adding tabs, not removing. It was easy for me to do just by editing the navtab template or sometimes creating a small plugin. Now after 4.2, I can't do that anymore.

I am wondering if there is an easy way hide a tab by the script it's running or somehow create something like this.

tbworld
08-19-2014, 09:41 PM
I have not tried this, but it should work.

Create a show variable with your script name (THIS_SCRIPT), I am using 'faq' as my example tab and script:

// hook: load_show_variables

$show['this_faq'] = THIS_SCRIPT === 'faq' ? true : false;
//var_dump($show['this_faq']); // Diagnostic
In the navigational manager under your new tab find "Show Permission Name" and add in the text-area field: this_faq

I will test this a bit later when I get a chance, but give it a whirl. :)

------------------------------------

You can add additional show variables you created by using a "." between the variables (. = AND). I think the help button gives an example.

$show['faq_notab'] - shuts off this tab under certain conditions -- Just create a new show variable, like above.
Example: this_faq.faq_notab (Combined permissions on "Show Permission Name")

I am not sure the example conditions would ever exist in combination... I was just trying to throw an example together quickly. :)

RisingGlow
08-20-2014, 12:56 AM
I have not tried this, but it should work.

Create a show variable with your script name (THIS_SCRIPT), I am using 'faq' as my example tab and script:

// hook: load_show_variables

$show['this_faq'] = THIS_SCRIPT === 'faq' ? true : false;
//var_dump($show['this_faq']); // Diagnostic
In the navigational manager under your new tab find "Show Permission Name" and add in the text-area field: this_faq

I will test this a bit later when I get a chance, but give it a whirl. :)

------------------------------------

You can add additional show variables you created by using a "." between the variables (. = AND). I think the help button gives an example.

$show['faq_notab'] - shuts off this tab under certain conditions -- Just create a new show variable, like above.
Example: this_faq.faq_notab (Combined permissions on "Show Permission Name")

I am not sure the example conditions would ever exist in combination... I was just trying to throw an example together quickly. :)


Ah this works perfect. Thanks!

tbworld
08-20-2014, 02:25 AM
Glad to hear. :)