0

The user page doesn't look good. I want to edit it, but (If I am right) that is a default page. I am not able to find where to edit it.

How can I edit the user page?

  • 1
    Explain it clearly, your question not understandable – Bala May 24 '13 at 6:19
  • 3
    hi...welcome to drupal answers...Your question is too broad. Please do some research and then may be put up an exact issue so that we can be more helpful. For starters, google. Just to get you started you can use panels which has build in user pages to customize. You may also do the same bu creating a template file as user-profile.tpl.php – why May 24 '13 at 6:20
  • 1
    The important thing to understand is that the user "page" in Drupal is not actually a "page" in the same way that a node (e.g., a Page or Article when you go to create content) is a page. – Patrick Kenny May 24 '13 at 6:23
  • I have a web site in with /user page is used for login as well as every drupal page have/user login and look of that login page is not good I just want to change it – Mohit Goyal May 24 '13 at 6:42
2

The page at http://example.com/user has two purposes:

  • Showing the login form for the users who are not logged in
  • Showing the profile page for the users who are logged in

In the first case, there isn't anything that you can edit to change how the login form is rendered. What you can do is implementing hook_form_user_login_alter() in the theme you are using, or in a module, to alter how the login form is rendered. In this case, you can use the #prefix and #suffix properties to inject CSS classes to the form fields, and #attached to load a new CSS file containing the CSS styles you need.
The alternative is associating a theme function to render the login form, through #theme.

In the second case, with the exception of the template file used to render the page, there isn't any file you can edit to change how the user profile page appear. Editing the user-profile.tpl.php template file used by the currently used theme is the easier, and faster way to change how the user profile page appears.
The alternatives are:

See also Gisle Hannemyr's answer; if you just need to change the order in which the fields associated with a user account are rendered, or slightly changing how those fields are rendered, that is the answer for you.

| improve this answer | |
1

To configure how fields should be displayed when rendering a user profile page, navigate to:

Home » Administration » Configuration » People » Account settings

and click on the Manage Display tab.

This lets you rearrange the order fields are presented on the user profile page, and to hide certain fields, but not very much more.

To make more profound changes, you need to change the templates that determine the look of the user profile page. This is a too broad subject to cover here. Read up on Drupal templates (.tpl.php files), and ask specific questions here if you get stuck.

The most important of these is the user-profile.tpl.php. However, the Drupal template system is extremly flexible (and somewhat daunting), and allows you to create overrides at all levels, so there are not only a template for the full page, but also templates for the fields that appear in it, etc.

| improve this answer | |
  • but user-profile.tpl.php only prints attributes – Mohit Goyal May 24 '13 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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