Jump to content

creat new child in navbar


nimafire

Recommended Posts

Hey, i want to add new item in navbar + 3 child

like:

Main-name 1)item1 2)item2 3)item3

 

it possible to add "Main-name" in navbar with:

 

$primaryNavbar->addChild('Main-name')

->setOrder(81);

 

now how can i add these 3 items to "Main-name" ?

Link to comment
Share on other sites

This should work

 

$primaryNavbar -> addChild('Main-name') -> setOrder(81);
$primaryNavbar -> getChild('Main-name') -> addChild('item1', array('label' => 'item1', 'uri' => 'item1', 'order' => '1', ));
$primaryNavbar -> getChild('Main-name') -> addChild('item2', array('label' => 'item2', 'uri' => 'item2', 'order' => '2', ));
$primaryNavbar -> getChild('Main-name') -> addChild('item3', array('label' => 'item3', 'uri' => 'item3', 'order' => '3', ));

Link to comment
Share on other sites

This should work

 

$primaryNavbar -> addChild('Main-name') -> setOrder(81);
$primaryNavbar -> getChild('Main-name') -> addChild('item1', array('label' => 'item1', 'uri' => 'item1', 'order' => '1', ));
$primaryNavbar -> getChild('Main-name') -> addChild('item2', array('label' => 'item2', 'uri' => 'item2', 'order' => '2', ));
$primaryNavbar -> getChild('Main-name') -> addChild('item3', array('label' => 'item3', 'uri' => 'item3', 'order' => '3', ));

nice one, i have fix my code now,

how about HR? how can i add line between child items?

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