I would like to know how to create a user profile (registered user block) similar to the one on this site. I am using Drupal 7 and the Zen theme.
-
where do you want to show it? Next to nodes and comments?– uweNov 7, 2011 at 4:05
-
hi, in the user account (view section).– Jasmine AhmedNov 7, 2011 at 10:11
-
To what are you referring? You say, "similar to the one on this site," but it's not clear to what you are referring. A screenshot could be helpful.– apaderno ♦Nov 7, 2011 at 10:36
-
i'm referring to the registered user block where you have the profile picture on the left and bio on the right...– Jasmine AhmedNov 7, 2011 at 13:31
4 Answers
In Drupal 7, users accounts are fieldable entities like nodes. From Administration » Configuration » People » Account settings, you can add fields and configure their display on the user page (ie. /user/$uid).
For a more complex setting with multiple profile types and separation of accounts (ie. user) and profiles, you can use the Profile2 module.
You can then use Views to easily crate blocks and pages to list users and information from their profiles.
-
i've managed to create what seems to be a reasonable user profile, thanks. However, am struggling with spacing the fields. I mean the users first name appears above the last name but they are too close to each other. how can i increase the space between the 2? And secondly, how can i divide the fields into sections, like basic information, interests, contact details etc? Nov 7, 2011 at 15:07
-
The Field group module allows (drupal.org/project/field_group) grouping fields into, well, groups. Spacing between element is a theming issue and can be achieved in your theme (if you use a Drupal core or third party theme, don't hack it but create a sub-theme). Nov 7, 2011 at 16:01
-
thanks again for the help, i really appreciate it :) One last question, how do make the group field heading or title (e.g. Basic Information) appear on the profile. i've successfully managed to group the fields but the headings are not appearing on the profile. Nov 7, 2011 at 16:55
You can add fields to users like you can with content types, you can find it at admin/config/people/accounts/fields.
The fields will show up at account creation, edit and view.
-
i've managed to create what seems to be a reasonable user profile, thanks. However, am struggling with spacing the fields. I mean the users first name appears above the last name but they are too close to each other. how can i increase the space between the 2? And secondly, how can i divide the fields into sections, like basic information, interests, contact details etc? Nov 7, 2011 at 15:08
you can use views to create a block with profile information and then show it on the user profile page, take a look at this example.
If you want more control over the layout you can also do a template override on the user-profile.tpl.php. Just copy it from /modules/users directory into your current theme directory and make changes there.
there is profile2 module or maybe profile lite, or you can use edit profile. or the Profile UX . I prefer Profile UX honestly.
For the view you can use Views, Display Suit ...
In Views you can create a block views and place it where you want, but if you wanna personalize it you need to use the Context module.
Also you can go "yourpage.com"/admin/config/people/accounts/fields and create some custom field for your profile and then go to "yourpage.com"/admin/config/people/accounts/display to customise how it looks.
But if you wanna override the drupal /user/ page you need ctool and the page manager that is a componet of ctool, there is a video tutorial here and there is a plugin module called Contextual Administration and the video tutorial is about how to use it (http://www.youtube.com/watch?v=R5gpUfAXrAg) his blog is (https://plus.google.com/u/0/107801555171748743621/posts)