So I have been doing some searching around with no luck. What I am looking for is a way to make a user menu like what Facebook has that will allow you to selecet a group you are members of and also to hose the links for Administration (Admins option only), User Settings and the Log out option.
I know how to make an Elgg menu but how do I hide the current options from users.
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.
Create
Hide
Ok so looking at the links you have given me this will hide links on the standered elgg theme where they ran across the blue bar. What I need is a way to over ride the calls for the menu items Administration, Settings and Log out so I can hide this from all users and place them in a new Menu which says "Hi <User Name>" and will have a pull down list.
And depending if the user is of Admin or just User will show the different menu items for that user.
The above links are references to universal functions.
You're talking about topbar's menu items.
So, if you want to hide some items, just do it:
using the above code does not remove the Administration, Settings or Logout they leave it all there. But UI have managed to remvoe Profile, Message and Friends with this code
It depends on how the menu items are registered by the other plugin (or Elgg core).
If they are registed using elgg_register_menu_item() you can unregister the menu item again with elgg_unregister_menu_item() as RvR explained.
If the menu item is registed using a plugin hook (i.e. 'register', 'menu:<MENU NAME>') then you can unregister the plugin hook handler that was defined in the other plugin (or Elgg core) using elgg_unregister_plugin_hook_handler().
For reference of the functions' parameters check out http://reference.elgg.org.
@iionly
Thanks for that but then where are Administration, Settings and Log Off actuall called then as they are core elgg things I am thinking but have no clue where to find them with in the code
;) It'll be work if you register your pagesetup handler:
@FusionOz
check it
Thank you very much for your help @RvR. I now have all things working and now need to move on to only showing Administrators the Admin link which is well a lot of work now on my end.
What's about:
- Previous
- 1
- 2
- Next
You must log in to post replies.