This question is about the profile icon in top bar left. Is it possible to add the user name after it? Using Elgg 1.8.13.
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
- jon666@jn6V2

jon666 - 0 likes
- Nikolai Shcherbin@rivervanrain

Nikolai Shcherbin - 0 likes
- Cim@manacim

Cim - 0 likes
- jon666@jn6V2

jon666 - 0 likes
- Nikolai Shcherbin@rivervanrain

Nikolai Shcherbin - 0 likes
- Cim@manacim

Cim - 0 likes
- learning@learning

learning - 0 likes
You must log in to post replies.Use this hook:
Thanks RvR. Will research about "hooks" and try and figure out what script to add it to.
Try my 'dumbest' plugin
In start.php add above code instead of
if you want to move it left or right in the top bar then add this to the array
Many thanks RvR - works like a charm! Only thing is the user avatar is gone but that really doesn't matter.
Cim, priority not needed as it's exactly where I wanted it. Good to know for future though - thanks.
@jon666 I've thinked that you want replace avatar with username :)
If you want to display avatar and username both then you need this code:
$user = elgg_get_logged_in_user_entity();
elgg_unregister_menu_item('topbar', 'profile');
elgg_register_menu_item('topbar', array(
'href' => "/profile/$user->username",
'name' => 'account',
'text' => "<img src=\"{$user->getIconURL('topbar')}\" class=\"elgg-icon elgg-inline-block\" alt=\"$user->name\"/>" .$user->name,
'title' => $user->name,
));
just comment out or remove this line of code
@RvR
Trying to do this to display both Avatar and Name for logged in User.. am using Elgg 1.8 with Social Login
Made a plugin and could activate it via Admin login .after activation the Admin User Icon and Name come up fine. But after Admin logs out, there is simply a blank page.. once the plugin is deleted, normal behavior resumes.
How to correct ? pl advise...am a just cut and paste coder so all details much appreciated, thanks!