You are here

user-profile.tpl.php

This template is used when viewing a registered member's profile page,
e.g., example.com/user/123. 123 being the users ID.

Use render($user_profile) to print all profile items, or print a subset
such as render($user_profile['user_picture']). Always call
render($user_profile) at the end in order to print all remaining items. If
the item is a category, it will contain all its profile items. By default,
$user_profile['summary'] is provided, which contains data on the user's
history. Other data can be included by modules. $user_profile['user_picture']
is available for showing the account picture.

Field variables: for each field instance attached to the user a
corresponding variable is defined; e.g., $account->field_example has a
variable $field_example defined. When needing to access a field's raw
values, developers/themers are strongly encouraged to use these
variables. Otherwise they will have to explicitly specify the desired
field language, e.g. $account->field_example['en'], thus overriding any
language negotiation rule that was previously applied.

Where the html is handled for the group.
Where the html is handled for each item in the group.

$user_profile is a renderable array, so all of the fields should come through unrendered. The title would typically be contained in an array element '#title'. This can be changed, unset, or set to NULL in the preprocess function 'themename_preprocess_user_profile', and this will stop the display of that title.

To take an example from the standard user profile - the annoying 'member for' display. This is stored in:

$user_profile['summary']['member_for']

This element has three properties - #type, #title, and #markup. We could set the title to NULL in the preprocess function as follows:

$user_profile['summary']['member_for']['#title'] = NULL

To completely remove the field we could use the hide function as follows:

If I have 3 profile types and I want to set a unique set of keywords for each profile type, how would this look in php? I need an if statement to identify the profile type then a statement to set the keywords to some (token) content in the database relevant to this profile.