8

I want to add a real name field beside the default username when I creat a new user in admin/people/create. How can I do this?

I have checked the RealName module but is not doing what I need.

5 Answers 5

9

Simply add a textfield (or two, if you want first/lastname) to your users at admin/config/people/accounts/fields. That will allow them to enter their realname and it will be displayed on the user profile page.

And if you want to display that name in various places (like node author), that's exactly what Realname module is for. It allows to configure the displayed name based on tokens (which can either be profile fields or user fields).

3

You can add fields to the user in "Administration » Configuration » People" and then manage the fields.

2

The best module for this is https://drupal.org/project/name, I would guess. It manages given, last and middle names and all sorts of suffixes and prefixes like "Dr.", "Jr." and so on. It even has settings for the order of first and last name, so an asian user could choose to display his last name first and a european user his first name.

2
  • It's worth nothing the setting that is on the field that enables the real name functionality.
    – rooby
    Dec 16, 2014 at 0:52
  • If you have your name field on a profile2 profile then you also currently need this patch for the name module: drupal.org/node/2087263
    – rooby
    Dec 16, 2014 at 0:53
0

Install the Profile2 module and Entity API, then add a 'real name' textfield to the user profile.

Profile2 is recommended over the core profile fields, because as the module page says:

Designed to be the successor of the core profile module, which is deprecated for Drupal 7. In contrast to the deprecated module this module provides a new, fieldable 'profile' entity - leverage the power of fields!

1
  • If you need a separate profile entity, yes. Adding fields to the user object does not in any way involve the core profile.module (which is hidden in new D7 installations so you can't actually install it) works perfectly fine.
    – Berdir
    May 10, 2011 at 13:41
0

The Real name module, once you understand it, is simple, but there are no instructions at all (!?).

Here is my version of short instructions to help folks out there: For Drupal 7 only.

  1. If needed, create a text field in Account Settings > Manage Fields.
  2. In the Real name settings (Config.>People), there is a link to browse all tokens options: simply use your desired field instead of core User name. Your custom User fields will appear as token options.

The name shown for accounts will automatically be replaced by the chosen token or profile field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.