1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to add to menu?

Discussion in 'XenForo Development Discussions' started by Paul, Nov 11, 2011.

  1. Paul

    Paul Well-Known Member

    I have added a new public function to controlleradmin/tools.php, and managed to call it manually.

    How can I add this function to the tools menu in the ACP so i can call this th lazy way i.e. button click :D

    Thanks
    Paul
     
  2. ragtek

    ragtek Guest

    1. i hope you've used the event listener system to add the method and not via file edit:p

    2. you can create new acp menu entries in your acp => development => admin navigation (you need to enable debug mode to see the development tab)
     
  3. dmnkhhn

    dmnkhhn Active Member

    I quick (pro) tip:
    During the creation of an admin navigation you are asked for an „Admin Navigation ID“.
    It sounds trivial but this ID is used in your "WhatEver_Route_PrefixAdmin_Something' as the third parameter of "$router->getRouteMatch()"

    So that means if you create an admin navigation with the ID of "test123" the corresponding line in AdminPrefix/Something.php has to look like this:
    return $router->getRouteMatch('WhatEver_ControllerAdmin_Something', $action, 'test123');

    What happens if you don't pay attention to this is that the AdminController you are linking to will always open in the home tab and the breadcrumb won't work.

    It took me twenty minutes to figure out so I thought I'd share it with you. :)
     
    BamaStangGuy, shadrxninga and sonnb like this.

Share This Page