Here's a pretty simple method for creating a new tab in the navbar, along with a submenu to go along with it. All you need is a unique condition for when your tab will be shown. What you will be making is a plugin to create the Nav Link along with a submenu which Link 1, Link 2, Link 3, and Drop Down which then drops down and has SubLink 1, SubLink 2, and SubLink 3. This is shown below.
NOTE: This is for 4.0.x and 4.1.x. In 4.2.x, you should be using the Navigation Manager.
This article is NOT to be used just to add another link to a submenu. It is for creating the Nav Link tab along with all the submenus. Again, if all you want is to add submenus to an existing tab, then this article is NOT for you!!!
This article is also for use by users who understand the basics of conditions and can write them. The navbar is not really an easy thing to play with if you don't know what you are doing - I think even Wayne said it had issues - so don't try this if you don't understand how to write a condition.
OK, with that out of the way....
Here's the basic template for making your new tab:
Create a plugin (Plugins & Products) > Add New Plugin:
hook location - process_templates_complete *
Title - New Tab for Navbar
Execution Order - 5
(* I used to have this listed as global_state_check but then noticed vb themselves use the process_templates_complete hook location, so I changed it.)
Your condition MUST be unique! If you use a condition that is also going to evaluate to true for another tab, then they will both be highlighted and the wrong submenu may show up underneath.
Hi Lynne, thanks for another great guide (Yes, I'm a suck up).
Just wondering if could have it so the sublink menu popup menu can be displayed when hovering your pointer over it instead of having to click, is there an in-built JS within VB to do this or would I have to use an external one?
Hi Lynne, thanks for another great guide (Yes, I'm a suck up).
Just wondering if could have it so the sublink menu popup menu can be displayed when hovering your pointer over it instead of having to click, is there an in-built JS within VB to do this or would I have to use an external one?
Could probably do it with javascript or some creative css, but I haven't looked into it.
i want to add a new "nav link" to go to the privet messages.
like in this original photo- how can i do that ?
Did you read the article? What code have you written to try to do what you want and what were the results? I can't tell you want is wrong unless you post your code and an image of the result and you tell us what is wrong with the result.
Quote:
Originally Posted by Sarcoth
Can this plugin call variables from my custom page?
I'm looking to use this menu to sort the tables on my custom page. My custom page creates an array (which you may be familiar with in another post):
Anyhow, instead of link1, I'd like to use $columns['title1'] in this plugin.
I don't know. I've never tried what you want to do. You'd have to make your variables available to the plugin by defining them prior to this plugin being rendered. So, depending on how you go about it, you should be able to do what you want.
I don't know. I've never tried what you want to do. You'd have to make your variables available to the plugin by defining them prior to this plugin being rendered. So, depending on how you go about it, you should be able to do what you want.
Thanks for the reply Lynne. That's actually my question. How do I make the variables available to the plugin. Perhaps this isn't a question for this thread now that I think about it. I'll look around some more and maybe just post it in the Programming forum instead. Thanks Lynne.