Closed (fixed)
Project:
Views (for Drupal 7)
Version:
5.x-1.6
Component:
Views Data
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Aug 2008 at 19:08 UTC
Updated:
26 Aug 2008 at 01:42 UTC
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
Comment #1
merlinofchaos commentedI 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.
Comment #2
youplatform commentedThank you very much - this was very helpful! The var id was $data->users_uid, btw.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.