Nickname instead of users real name?

I have searched online in both the vast interwebs as well as within this community for the answer and I cannot seem to find it.  Maybe I just don't know what to search for.

Is there a way to display the users "nickname" the one they used to sign up for an account instead of the users "actual" name?  I am aware that Elgg has several places throughout the code that shows the users real name, but if I could only find one good example of how to change that to the users nickname, I'm certain that changing it in all of the other places would go smoothly.

If someone could provide a code snip-it that displays that information or could point me in the right direction, that would be hugely helpful.


  • $user->username is the username and $user->name is the display name (or nickname). The username must be unique and the display name doesn't. Users can change their display name anytime they want to.

  • Cool thank you.  I'll look into it.

    I actually disabled the ability to change your name because I'm using Joomla with JFusion, Elgg AND phpBB.  So it was just weird when a user would log into Joomla with thier username, and then be taken to Elgg where they display their real name.  Then go into phpBB where it displays their username.

    So for the sake of consistency, I wanted to only be able to show their username.

    Thanks again.

  • @Cash what files to edit to change so it uses username instead of realname ?

  • I think it might be useful for Elgg to adopt the Drupal approach here, where the user's name is displayed using an over-ridable view, so the theme designer can decide whether to use the username, display name, or some combination of the two.

  • Well I searched the entire Elgg directory and looked for $user->name and I found it in several places because of the fact that a lot of plugins reference these files.  So I changed $user->name to $user->username and unfortunately nothing changed.  The site still worked, but the names didn't change.


    I also double checked to make sure that Elgg's cache settings were disabled, cause I thought that maybe the old files were in the cache.


    Anyone have any other ideas?

  • Do you have to edit code in order to display nicknames instead of full names? I didn't see an option for a nickname when I set up my elgg site. I don't want to display users' real names unless they make their nick name their real name. Am I missing something?