function template_preprocess_profile_listing

7.x profile.module template_preprocess_profile_listing(&$variables)
6.x profile.module template_preprocess_profile_listing(&$variables)

Process variables for profile-listing.tpl.php.

The $variables array contains the following arguments:

  • $account
  • $fields

See also

profile-listing.tpl.php

File

drupal-7.x/modules/profile/profile.module, line 566
Support for configurable user profiles.

Code

function template_preprocess_profile_listing(&$variables) {

  $variables['user_picture'] = theme('user_picture', array('account' => $variables['account']));
  $variables['name'] = theme('username', array('account' => $variables['account']));
  $variables['profile'] = array();
  // Supply filtered version of $fields that have values.
  foreach ($variables['fields'] as $field) {
    if ($field->value) {
      $variables['profile'][$field->name] = new stdClass();
      $variables['profile'][$field->name]->title = $field->title;
      $variables['profile'][$field->name]->value = $field->value;
      $variables['profile'][$field->name]->type = $field->type;
    }
  }

}