profile-listing.tpl.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * @file
  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. * - $account: User's account object.
  12. * - $user_picture: Image configured for the account linking to the users page.
  13. * - $name: User's account name linking to the users page.
  14. * - $profile: Keyed array of all profile fields that are set as visible
  15. * in member list pages (configured by site administrators). It also needs
  16. * to have a value in order to be present.
  17. *
  18. * Each $field in $profile contains:
  19. * - $field->title: Title of the profile field.
  20. * - $field->value: Value of the profile field.
  21. * - $field->type: Type of the profile field, i.e., checkbox, textfield,
  22. * textarea, selection, list, url or date.
  23. *
  24. * Since $profile is keyed, a direct print of the field is possible. Not
  25. * all accounts may have a value for a profile so do a check first. If a field
  26. * of "last_name" was set for the site, the following can be used.
  27. *
  28. * <?php if (isset($profile['last_name'])): ?>
  29. * <div class="field last-name">
  30. * <?php print $profile['last_name']->title; ?>:<br />
  31. * <?php print $profile['last_name']->value; ?>
  32. * </div>
  33. * <?php endif; ?>
  34. *
  35. * @see template_preprocess_profile_listing()
  36. */
  37. ?>
  38. <div class="profile clearfix">
  39. <?php print $user_picture; ?>
  40. <div class="name">
  41. <?php print $name; ?>
  42. </div>
  43. <?php foreach ($profile as $field): ?>
  44. <div class="field">
  45. <?php print $field->value; ?>
  46. </div>
  47. <?php endforeach; ?>
  48. </div>