Curious if anyone has pulled fields from the Bio module and display them along with users comments in the forum or on others posts? I can pull it into the first post as node is assigned to that user, but can't figure how to pull for each subsequent user and comment. If anyone has attempted this, any direction would be appreciated, thanks.

Comments

Anonymous’s picture

For anyone who would like to display cck fields from the bio profile simply add this to your comment.tpl.php file.


// Load the bio node for the user that is the author of the comment
$bio_node = node_load(array('type' => 'bio', 'uid' => $comment->uid));

// Print the first and last name field from the bio profile
print $bio_node->field_account_fname[0]['value'] .' '.  $bio_node->field_account_lname[0]['value']

Replace: $bio_node->field_account_fname[0]['value'] with your CCK fields.

allie micka’s picture

Status: Active » Closed (fixed)

Thanks for the snippet kristyb2008!