diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-08-02 10:36:42 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-08-02 10:36:42 +0000 |
commit | 99276849da740da568b54f165aa5256639a133b0 (patch) | |
tree | 011681b6f09353d0a5614e2301a152c85dd9dd73 /modules/profile/profile-block.tpl.php | |
parent | fe7faf76c20da61dc9fe99108e30a36fc13cb130 (diff) | |
download | brdo-99276849da740da568b54f165aa5256639a133b0.tar.gz brdo-99276849da740da568b54f165aa5256639a133b0.tar.bz2 |
- Patch #162134 by dvessel: tplify profile module.
Diffstat (limited to 'modules/profile/profile-block.tpl.php')
-rw-r--r-- | modules/profile/profile-block.tpl.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/modules/profile/profile-block.tpl.php b/modules/profile/profile-block.tpl.php new file mode 100644 index 000000000..995f59124 --- /dev/null +++ b/modules/profile/profile-block.tpl.php @@ -0,0 +1,41 @@ +<?php +// $Id +/** + * @file profile-block.tpl.php + * Default theme implementation for displaying a users profile within a + * block. It only shows in relation to a node displayed as a full page. + * + * Available variables: + * - $picture: Image configured for the account linking to the users page. + * - $profile: Keyed array of all profile fields that have a value. + * + * 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 template_preprocess_profile_block() + */ +?> +<?php print $picture; ?> + +<?php foreach ($profile as $field) : ?> + <p> + <?php if ($field->type != 'checkbox') : ?> + <strong><?php print $field->title; ?></strong><br /> + <?php endif; ?> + <?php print $field->value; ?> + </p> +<?php endforeach; ?> |