0

Using Drupal 7 and I would like to display the username and email under the view tab of the /user page.

Out of the box it only shows the user History, which I find a bit meaningles. I think that a user should see all his info under the view tab (including username and email) and then when he wants to edit it he can click on the edit tab.

Would be nice if this could be done with a block or similar so that this does not apply to the admin user.

Thanks!

1 Answer 1

1

You can always create a block through Views and display this information. Here's how to do that:

  1. Create a new view, choose to show "Users" and create only a block.

  2. Add "E-mail" field.

  3. Add "Contextual filter" for the "User: Uid" field.

  4. For filter configuration choose "Provide default value" and then "User ID from URL".

  5. Show the block in content area, and configure it so it's displayed only on specific pages. Enter the aliased path you use for user profiles. For example: profile/*. This is necessary because the system URL for user profile pages is user/[uid], which you cannot distinguish from user/login, user/register and so on.

Do note that this will make the username/email available to everyone who has the permission to view user profiles.

Hope this helps.

0

Your Answer

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

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