Jump to content

NavBar Sub Menu


TGK

Recommended Posts

Hi, thereis any way to add sub menu to menu options in Primary Nav Bar.

Primary option " Services "

Services 
VPS Cheaps <-- I need add other 4 sub menu Options  for this option also
VPS Regulars <-- I need add other 4 sub menu options for this option also
VPS FULL <-- I need add other 4 sub menu options for this option also

code example:
 

Quote

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
   {

   $primaryNavbar->addChild('Services X')         
        ->setOrder(11);

   $primaryNavbar->getChild('Services X')
               ->addChild('VPS Cheaps')
               ->setUri('https://example.com/cart.php?a=add&pid=14')
               ->setOrder(1);

 // i need that child " VPS Cheaps " have 4 sub child ( menu) on something like that.

thanks in advance

Link to comment
Share on other sites

2 hours ago, TGK said:

there is any way to add sub menu to menu options in Primary Navbar.

just by using a hook? not easily.

the problem would be that the navbar template is expecting parent and child, whereas you want to give it grandparent, parent and child.

I believe the array itself could handle more than 2 levels, but you'd have to rewrite the template to expect it and output it correctly... whether that's worth the effort, or if it would be quicker to dump navbar and use a megamenu solution instead, is for you to decide.

the other way would be to fake indentation of your grandchildren links...

UvF3aG1.png

but from your description, you're going to end up with a dropdown of 15+ items..

Link to comment
Share on other sites

@TGK

On 29/08/2018 at 00:13, TGK said:

yes you right actually i have 10 dropdown items and i need to put then in categories.

just as an update to your question, you can create nested menus using the Advanced Menu Manager addon...

mKwUwuC.png

there is an online demo available, linked from their CodeCanyon page, where you can play with the admin functionality, and you'll instantly see the results on the client side.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated