HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

3.0.2 Adding menu item to Moderation sidemenu

I'm making an infraction plugin for moderators to use on my site, but I can't seem to get a link to show up on the Moderation tab.

Been trying with this code (and changing 'Moderation' to 'Forum' in addLink) but it only ever shows up on the Settings tab.

  public function base_getAppSettingsMenuItems_handler($Sender) {

    $Menu = $Sender->EventArguments['SideMenu'];

    $Menu->addLink('Moderation', t('Infraction'), 'plugin/infraction', 'Garden.Moderation.Manage');

  }

Comments

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Try it that way:


       public function dashboardNavModule_init_handler($sender) {
           // Create a group under the Moderation group.
           $sender->addGroupToSection(
               'Moderation',
               t('Infraction'),
               'infraction',
               'Infraction',
               ['after' => 'site']
           );
           // Add links to it
           $sender->addLinkToSectionIf(
               'Garden.Community.Manage',
               'Moderation',
               Gdn::translate('Sunshine'),
               '/plugin/Sunshineon/sunshine',
               'infraction.sunshine'
           );
       }
    


  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Look at the methods of the SiteNavModule to understand what the parameters in the snippet above are used for

  • Options

    Awesome, thanks for pointing me in the right direction.

Sign In or Register to comment.