profile-listing.tpl.php

  1. 7.x drupal-7.x/modules/profile/profile-listing.tpl.php
  2. 6.x drupal-6.x/modules/profile/profile-listing.tpl.php

profile-listing.tpl.php Default theme implementation for displaying a user and their profile data for member listing pages.

where all the data is collected and printed out.

Available variables:

  • $picture: Image configured for the account linking to the users page.
  • $name: User's account name linking to the users page.
  • $profile: Keyed array of all profile fields that are set as visible in member list pages (configured by site administrators). It also needs to have a value in order to be present.

Each $field in $profile contains:

  • $field->title: Title of the profile field.
  • $field->value: Value of the profile field.
  • $field->type: Type of the profile field, i.e., checkbox, textfield, textarea, selection, list, url or date.

Since $profile is keyed, a direct print of the field is possible. Not all accounts may have a value for a profile so do a check first. If a field of "last_name" was set for the site, the following can be used.

<?php if (isset($profile['last_name'])): ?> <div class="field last-name"> <?php print $profile['last_name']->title; ?>:<br /> <?php print $profile['last_name']->value; ?> </div> <?php endif; ?>

See also

profile-wrapper.tpl.php

template_preprocess_profile_listing()

1 theme call to profile-listing.tpl.php
profile_browse in drupal-6.x/modules/profile/profile.pages.inc
Menu callback; display a list of user information.

File

drupal-6.x/modules/profile/profile-listing.tpl.php
View source
  1. <?php
  2. /**
  3. * @file profile-listing.tpl.php
  4. * Default theme implementation for displaying a user and their profile data
  5. * for member listing pages.
  6. *
  7. * @see profile-wrapper.tpl.php
  8. * where all the data is collected and printed out.
  9. *
  10. * Available variables:
  11. * - $picture: Image configured for the account linking to the users page.
  12. * - $name: User's account name linking to the users page.
  13. * - $profile: Keyed array of all profile fields that are set as visible
  14. * in member list pages (configured by site administrators). It also needs
  15. * to have a value in order to be present.
  16. *
  17. * Each $field in $profile contains:
  18. * - $field->title: Title of the profile field.
  19. * - $field->value: Value of the profile field.
  20. * - $field->type: Type of the profile field, i.e., checkbox, textfield,
  21. * textarea, selection, list, url or date.
  22. *
  23. * Since $profile is keyed, a direct print of the field is possible. Not
  24. * all accounts may have a value for a profile so do a check first. If a field
  25. * of "last_name" was set for the site, the following can be used.
  26. *
  27. * <?php if (isset($profile['last_name'])): ?>
  28. * <div class="field last-name">
  29. * <?php print $profile['last_name']->title; ?>:<br />
  30. * <?php print $profile['last_name']->value; ?>
  31. * </div>
  32. * <?php endif; ?>
  33. *
  34. * @see template_preprocess_profile_listing()
  35. */
  36. ?>
  37. <div class="profile">
  38. <?php print $picture; ?>
  39. <div class="name">
  40. <?php print $name; ?>
  41. </div>
  42. <?php foreach ($profile as $field) : ?>
  43. <div class="field">
  44. <?php print $field->value; ?>
  45. </div>
  46. <?php endforeach; ?>
  47. </div>