By charlietuna on
Hello!
I am setting up a Drupal site that is a migration from WordPress. In WP it was possible to define a display name, that is, what users see when they see your work (blogs, etc.) Is it possible to get somebody's real name displayed in place of login ID in drupal? I am sure with a certain degree of hacking one could replace each instance of login name display with a call to the real name field of their profile, but is there an easier way?
Thanks in advance,
Andrew
Comments
First you will need to make
First you will need to make sure each user has their full name in a new profile field (see profile.module)
You can probably do it by editing the node.tpl.php (assuming you are using phptemplate engine).
The $node variable available in the template will contain the $node->uid which is the authors user id. You'll need to load the user account in order to retrieve the full users profile details.
Something like the following snippet in the node.tpl.php will do:-
<?php $author = user_load(array('uid' => $node->uid)); print $author->profile_field_name?>--
Custom Drupal templates | More Drupal modules
--
Ixis (UK): Drupal support, Drupal hosting.
I think its possible
Do you have to do that? I have a demo installation of 4.6.5, and I created another user after "Admin" and used my full name (including a space between the first and last names) and it works without modifying anything else.
When you click on "Register" on your website, it should say "Your full name or your preferred username; only letters, numbers and spaces are allowed." below "Username". Is this only for fresh/clean installations of Drupal?
We merged over a wordpress
We merged over a wordpress site, so everybody's login name was already set to something that wasn't their real name. It might work if we had started that way though, thanks.
Thank you! That worked
Thank you! That worked perfectly.