This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
I imagine that I am missing some small detail somewhere, so hopefully this is an easy one.
My plugin has a few models defined, and I am trying to add them to the administrative backend. Below is my implementation of registerNavigation(). The top level menu item works, however when I click on the link for it, it does not become the active menu item. And none of the sidebar items are displayed as well. Navigating directly to the urls also works just fine.
public function registerNavigation() { return [ 'friends' => [ 'label' => 'Friends', 'url' => Backend::url('dma/friends/badges'), 'icon' => 'icon-users', 'permissions' => ['friends.*'], 'order' => 500, 'sideMenu' => [ 'badges' => [ 'label' => 'Badges', 'icon' => 'icon-copy', 'url' => Backend::url('dma/friends/badges'), 'permissions' => ['friends.access_admin'], ], 'activities' => [ 'label' => 'Activities', 'icon' => 'icon-list-ul', 'url' => Backend::url('dma/friends/activities'), 'permissions' => ['friends.access_admin'], ], 'rewards' => [ 'label' => 'Rewards', 'icon' => 'icon-list-ul', 'url' => Backend::url('dma/friends/rewards'), 'permissions' => ['friends.access_admin'], ], ] ] ]; }
Your controller needs the line
BackendMenu::setContext('Your.Plugin', 'friends', 'activities');
in its __construct()
method.
kris2481 said:
boom....thank you. I knew i was missing a small detail
Hi, i have same problem,can you tell me ,what you missing?
1-5 of 5