I replaced the original topbar with my own bar because I lost my mind trying to edit the original topbar. I located it in views/default/page/elements/topbar.php
But I don't understand a few things
Is it possible to unregister the whole topbar to save on resources? The instructions say to unregister the components like this:
// Remove the "Elgg" logo from the topbar menu
elgg_unregister_menu_item('topbar', 'elgg_logo');
but how do I know (or where to find) the other strings that can be unregistered?
My current 'log out' link is simply mydomain.com/action/logout'
But the original 'log out' was much more complicated, with tokens and stuff e.g:
/action/logout?__elgg_ts=1410540736&__elgg_token=c90b15ab5877e123723be4385d6b269b
Why is it like that?
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.
See the Security part here: http://learn.elgg.org/en/latest/guides/actions.html#security
The topbar is not something that you can register/unregister. You're confusing views with menus.
But you can decide not to print the topbar at all. Just remove the part where it is added as part of the page.
Thanks! So I make the 'log out' link like this:
Seems to work though not even the previous one gave errors.
"But you can decide not to print the topbar at all. Just remove the part where it is added as part of the page."
If I remove the part where it is added
it removes my customized topmenu as well. I thought of just running over the original top bar and removing the extra components later but I guess it works as good like this.
Very bad solution.
Just combine PHP and HTML.
What's wrong with my above solution?
"What's wrong with my above solution?"
I don't understand it. I don't understand the logic of Elgg menus.
Why do you first unregister and then register elgg_unregister_menu_item('topbar', 'logout') ?
How can you echo it? I've tried all kinds of combinations with the example line in Elgg docs:
echo elgg_view_menu('my_menu', array('sort_by' => 'title'));
but can't get it to be displayed.
@Darth Vader
Because this item registred by default already.
In first, you need to unregister the 'core' items.
Then you can register your own items.
I've showed to you easiest way for customizing some items in 'topbar' menu.
But you can combine it with your own HTML links (menus) too.
If you customize 'topbar' menu only then you can provide it via your theme:
This is what my customize logout code looks like
@[cim] Sure, but it's not 'Zen-coder' way ;)
Thank you! I've still got problems making actual changes.
I have edited header.php to adjust the site menu for test purposes
but none of the changes are displayed on the site menu. What am I missing?
- Previous
- 1
- 2
- Next
You must log in to post replies.