API page: http://api.drupal.org/api/drupal/modules--user--user-profile.tpl.php/7

Describe the problem you have found:
author gives inaccurate and/or misleading information in at least two places with rgards to var $user
and $content in user-profile.tpl.php

Comments

jhodgdon’s picture

Status: Active » Postponed (maintainer needs more info)

Can you be more specific about which information is wrong or misleading please? This issue report is not very helpful as it is.

maxxer’s picture

apologies for not being more helpful:

render($content['field_example']).
$content variable does not appear to be exposed to this template.
print_r($content) returns nothing, for example.

$user->field_example has a variable $field_example defined.
Here I find the doc to be misleading. $user is exposed to user-profile.tpl.php but it contains variables related to currently logged in user.
field variables returned from $user do not apply specifically to the currently viewed user profile page unless the user happens to be viewing their own profile while logged in.

jhodgdon’s picture

Title: Documentation problem with user-profile.tpl.php » user-profile.tpl.php doc header is very confused.
Version: 7.x-dev » 8.x-dev
Status: Postponed (maintainer needs more info) » Active
Issue tags: +Needs backport to D7

OK. Someone needs to redo this documentation. It's apparently all wrong. See also the two comments posted at http://api.drupal.org/api/drupal/modules--user--user-profile.tpl.php/7

Needs to be fixed in d8 first, then backported.

jhedstrom’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)

This file has been removed, but it was also apparently already fixed over in #1123092: user-profile.tpl.php doc has confusing/misleading first paragraph.