I have many tables on my site right now (www.youplatform.com) where I'm displaying 'Node: Author name' in order to have a link to the author's profile page.

What I'd really like to do is display the author's real first name (profile_first_name) and have a link to this same page. For the life of me, I can't figure out how to do this.

I've read around the site a lot and have spent a lot of time trying to tweak template.php. I was able to get as far as outputting a link, but I don't know how to find a given uid from the data passed into this function. Any help would be greatly appreciated.

Here's what I have so far:


function phptemplate_views_handle_field_latest_services_profile_first_name_value($fields, $field, $data) {

    $fullname= $fields[$field['fullname']];
     $info = $fields[$field['fullname']];
    $uid = //HELP FINDING THIS!

 $link = l($info['handler']($info, $field, $data->$field['queryname'], $data), '?q=user/$uid);
return $link;

}

Comments

merlinofchaos’s picture

Status: Active » Fixed

I believe your uid is most likely going to be $data->user_uid -- but if you do a var_dump on $data you should be able to pick it out.

youplatform’s picture

Thank you very much - this was very helpful! The var id was $data->users_uid, btw.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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