@anonymous-piwik-user opened this Issue on September 8th 2009


Is it possible to hide or change the position for the main menu.
I write a plugin, and I want it to show in the first menu. And the default menu is my plugin, not dashboard.

In plugin manger, I can only desactive the plugin, and there is no way to hide the menu.

Some ideas for this feature:

  1. add hooks like this
    • "Piwik_Menu.remove" : hide the menu
      -"Piwik_Menu.move" : change the position of menu
      -"Piwik_Menu.default":set the default menu to show when we visit piwik/index.php
      With these hooks, we can write a plugin to achieve this feature.
  2. In "Settings"->"plugins",add some options for this feature.

Advanced feature:

  1. Administrators can show different menu for different user.
    • With hooks, developers can write a plugin to achieve this feature. But I think it will be better to add it in 'settings'.
  2. Visitors can directly move or remove the menu in UI.
@robocoder commented on September 8th 2009 Contributor

I don't think hooks should be used to change the behaviour of other plugins. Once #24 is done, it should be possible for plugins to provide this level of configurability.

In the meantime, please look at core/PluginsFunctions/Menu.php. You might be able to use Piwik_RenameMenuEntry() and Piwik_EditMenuUrl(). If you need more functionality here, submit a patch for your use case.

@mattab commented on September 8th 2009 Owner

One change might be to have the menu based on priorities to decide the order.

For example, dashboard would be priority 10, Actions = 20, Referers = 30, etc.
Then a method would allow to change priority of a given menu entry.

Any new menu added could put itself first (by setting any priority < 10), or in the middle of any other menu entry (for example, priority = 15 would put it after dashboard before Actions)

@anonymous-piwik-user commented on September 9th 2009

I think hide some menus is also necessary. Sometimes we don't want to show some menu but we want it be actived.

@mattab commented on May 1st 2010 Owner

This was implemented in Admin menus recently, see the function and code in: https://github.com/piwik/piwik/blob/master/core/PluginsFunctions/AdminMenu.php#L105

function Piwik_AddAdminMenu( $adminMenuName, $url, $displayedForCurrentUser = true, $order = 10 )

This could be done for the normal menu, and top bar menu too.

@mattab commented on July 7th 2010 Owner

This was fixed in #1403

This Issue was closed on July 7th 2010
Powered by GitHub Issue Mirror