octobro
octobro

Hi there

I am trying to generate a sidebar menu for a plugin but it doesnt seem to appear.

I have added this to my plugin.php in the root dir

public function registerNavigation()
{
        return [
    'checks' => [
        'label'       => 'Check',
        'url'         => Backend::url('acme/check/job'),
        'icon'        => 'icon-list',
        'permissions' => ['acme.check.*'],
        'order'       => 500,

        'sideMenu' => [
            'jobs' => [
                'label'       => 'Jobs',
                'icon'        => 'icon-copy',
                'url'         => Backend::url('acme/check/job'),
                'permissions' => ['acme.check.access_job'],
            ],
            'report' => [
                'label'       => 'See Report',
                'icon'        => 'icon-list',
                'url'         => Backend::url('acme/check/report'),
                'permissions' => ['acme.check.access_report']
            ],
        ]

    ]
];

}

and in the two controllers I have for both menus I have added in the following ('job' with 'report' at the end for the report controller)

public function __construct()
{
    parent::__construct();

    BackendMenu::setContext('Acme.Check', 'check', 'job');
    }

When I browse to the menu I still don't see the side menus. Any idea on what im doing incorrectly?

Many thanks.

Last updated

d.negativa
d.negativa

add "s" letter ))


public function __construct()
{
    parent::__construct();

    BackendMenu::setContext('Acme.Check', 'checks', 'jobs');
    }

Last updated

octobro
octobro

adding s hasn't worked.

 public function __construct()
{
    parent::__construct();

    BackendMenu::setContext('Acme.Check', 'checks', 'jobs');

}

That goes in the Job.php controller right? But ive tried check, jobs, Check, Jobs and nothing seems to appear in the backend.

octobro
octobro

Update: Have working thanks to wlvrn on IRC. I had incorrectly set the navigation key

 'checks' => [
    'label'       => 'Check',

where my actual plugin was called xchecks.

1-4 of 4