Hello everyone,
I'll desperately try to personallze the topbar menu in Elgg 2.3.3. I've tryed to use the elgg_unregister_menu_item to remove element from the topbar like the documentation says to do, but that doesn't seem to work. Is anyone have a functionnal idea ?
Thank by advance
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Nikolai Shcherbin@rivervanrain

Nikolai Shcherbin - 0 likes
- Benaesan@benaesan

Benaesan - 0 likes
- Nikolai Shcherbin@rivervanrain

Nikolai Shcherbin - 0 likes
- Benaesan@benaesan

Benaesan - 0 likes
- Nikolai Shcherbin@rivervanrain

Nikolai Shcherbin - 0 likes
- Benaesan@benaesan

Benaesan - 0 likes
- ihayredinov@ihayredinov

ihayredinov - 0 likes
You must log in to post replies.Which item's name? Bcz, some items cann't customize with this hook.
In the better case I want to remove all the elements, so I can reorder and add some css classes on them, without breaking the menu mecanism.
for example, the dashboard or site_notifications, can be remove, but that doesn't work with friends, messages or profile.
Messages:
Friends:
Profile:
Also, check your activated theme. Perhaps, there are the rewrited hooks/views
Ok thanks, that works for profile and messages but not for Friends.
That not really simple to make a theme in Elgg. It's a pity that's not standardized for all the menu items.
Then override _elgg_friends_page_setup:
Yeah thanks that works fine.
I've just found this method too:
So I can manipulate the menu item without breaking the standard mecanism.
But seem to doesn't work with all,
There is a menu hook intended just for this:
// register with higher priority so it's called after all other hooks elgg_register_plugin_hook_handler('register', 'menu:topbar', 'modify_topbar_menu', 1000); function modify_topbar_menu($hook, $type, $return, $params) { $remove = ['friends']; foreach ($return as $key => $item) { /* @var $item \ElggMenuItem */ if (in_array($item->getName(), $remove) { unset($return[$key]); continue; } switch ($item->getName()) { case 'profile' : $item->setText('Profile'); $item->setPriority(200); break; } $return[$key] = $item; } return $return; }