remove friends icon in topbar

how can i remove the friends icon in the topbar, i have it implied in my theme nice and the icon just makes things redundent

  • You need to hook into the register, menu:topbar hook and remove the item with the name "friends."

    Your callback would like something like this:

    FYI: I found this information by checking the HTML. All menus in Elgg have classes that let you guess the menu names. If you look at the menu item's <li> tag you'll see the class "elgg-menu-item-messages". Look up the DOM to the <ul> tag and you'll see the class "elgg-menu elgg-menu-topbar elgg-menu-topbar-default".

    These classes mean you're looking at the menu item named "friends" in the "default" section of the menu named "topbar".

  • Brett, wouldn't it be wonderful to have another hook before 'register' in the factory, which would allow to use register/unregister api, without having to iterate through the return array on 'register' to find the menu in question?

  • @Ismayil - I actually forgot about the unregister function. In this case you CAN use it because the friends menu item is registered by core. So you can replace the hook with elgg_unregister_menu_item('topbar', 'friends'). That's much simpler :)

Feedback and Planning

Feedback and Planning

Discussions about the past, present, and future of Elgg and this community site.