Hi,

My user profiles have a custom profile field for a biography (profile_bio). I can't find anywhere in the documentation the print variable i need to add to the tpl file to get it to display. Please advise. Many thanks! Kevin

Comments

michelle’s picture

Status: Active » Fixed

It's right in the .tpl file:

 * - $profile - Profile object from core profile.
 *     D5 Usage: $profile['category']['field_name']['value']
 *     D5 Example: <?php print $profile['Personal info']['profile_name']['value']; ?>
 *     D6 Usage: $profile['category']['field_name']['#value']
 *     D6 Example: <?php print $profile['Personal info']['profile_name']['#value']; ?>

Michelle

pyxio’s picture

Ufff... sorry for the oversight. Thanks for the great module. K

michelle’s picture

No problem. Now you know where to look. :)

Michelle

czeky’s picture

Hi, maybe I'm stupid, but created field "profile_name" under "Personal info" category, added print $profile['Personal info']['profile_name']['#value']; in author-pane-block.tpl.php right after print $account_name; , and nothing shows up in block. Many thanx for help, this is the module I was looking for a long time.

czeky’s picture

Hi again ;-) Yes, I'm stupid, thanx anyway.. ;-)))))

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dries arnolds’s picture

I'm trying to link a profile url field to an image icon, but #value seems to output an entire link. Is there a way to just output only the link?

Off course I could use another profile field instead of url, but then I would lose url checking for users during input.

This is what I have:

<?php if (!empty($profile['Contact']['user_website']['#value'])): ?>
	<a href="<?php print $profile['Contact']['user_website']['#value']; ?>"><img src="/files/homepage_16_on.png"></a>
<?php else; ?>
	<img src="/files/homepage_16_off.png">
<?php endif; ?>
Steel Rat’s picture

Do you have code to do this with D7?

Scyther’s picture

Have created a doc page for this: http://drupal.org/node/1488468

@Stteel Rat, you will get your answer on that doc page.