Last updated 15 May 2012. Created on 21 February 2011.
Edited by ezra-g, Dave Reid. Log in to edit this page.

The Realname module for Drupal 7 is very different from previous versions.


Rather than configuring which modules should provide the fields for realname, the module now relies completely on the Token API that is built into Drupal 7 core. We also depend on the Token module that is not in core to be able to view the token UI. As a result, you must have the Token module downloaded and enabled before enabling the Real name module.

By default the realname pattern is [user:name-raw] which is simply the 'Name' field provided by core on user edit pages.

If you migrated your site from Drupal 6 and were using the core 'Profile' module, the profile field tokens are provided and available for selection.

If you are using Fields to build your user's profile, then you can either wait for Field token support to be finalized in Token module (#691078: Field tokens) or you can use the 'Entity Tokens' sub-module of the Entity module, although the latter is not recommended as a long-term solution by the Token maintainers.

Writing code that outputs a user's name

If you have written a Drupal 7 module that output's a user's name anywhere, you should always use either check_plain(format_username($account)) if the name is in plain text, or if your output is fine possibly including a link to the user, then you should use theme('username', array('account' => $account)) same as Drupal 6.

Note, RealName does not provide out-of-the-box support for Profile2 module, but does have an API that makes compatibility with Profile2 module possible through additional code..

Looking for support? Visit the forums, or join #drupal-support in IRC.


sry’s picture


in "permissions" I can only find "Real name>Administer Real Name configuration". I want to hide realnames for visitors, am I right that if there was a permission "use realname" i could achieve this by not granting to guests? If so, how can I get the missing feature - did I make a mistake configuring the module or do I have to wait for a release that (hopefully) contains this? Or, is there an alternative way to hide realnames for visitors?


buelowp’s picture

I've been playing around with this module to allow me to map the LDAP fields givenname and sn to a firstname and lastname, but am not having any luck. Any thoughts as to how I should correctly do this? I'm loving the fact I can use an email address now, as our userid's are terribly not descriptive, but a real first and last name would be golden. I'll keep playing with it tomorrow, but am hoping this is easy. Thanks for the great module though.