By joachim on
Is there a module that allows users to have a display name instead of a username?
I'm making a site for a local organization, so it's important that the site show real names.
While I was running a test site, it quickly became apparent that nearly EVERY volunteer wanted to use their usual online nick as a username, because they could remember it. So I had users called 'jon234' or whatever, and when I insisted they use real names they forgot their login details.
I know I could stick in a profile field and use theming to overrite theme_username(), but I'd like something that works across all themes and doesn't need maintaining.
Comments
Override the Profile Module theme.
Add a profile field for full name, you need to store it somewhere.
Rather than pulling that in a theme, add this to template.php which is global to all themes.
Then create a new file (in your theme folder) called user_profile.tpl.php - with the code of that function in the user.module as a starting point, modify it to get the user profile looking the way you want. I often setup the profile fields, and then place them specifically in this file.
Here's a sample, placing a first name / last name profile fields into specific areas on the page...
I actually want to change
I actually want to change all instances of a user's name -- on node "created by" text, comments, etc.
subscribing
subscribing
Hi, Think you need to
Hi,
Think you need to overide the theme_username function and grab the name from the profile module:
I've not tested this but worth a try
Cheers
Tom
______________________________________________
http://drupalsn.com/user/thomjjames
______________________________________________
https://tomswebstuff.com
hook_username_alter worked for me...
I added two fields to my user profile (field_first_name and field_first_name) and then I added a preprocess function in template.php like so:
There are other ways to do the same thing, but this worked for me.
This works for me:
This works for me: