Closed (fixed)
Project:
References
Version:
7.x-1.x-dev
Component:
Code: user_reference
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Aug 2011 at 01:41 UTC
Updated:
13 Oct 2011 at 11:26 UTC
I've content type with a user_reference field associated, named: field_responsible_id
trying to access prgramatically to the user data (associated through the user_reference field), from a custom view, I have:
$node->field_responsible_id['en'][0]['uid']
so, I'm getting the user name by : $userName = user_load( $node->field_responsible_id['en'][0]['uid'] )->name
I'm wondering if is there a better way to accomplish this ?
thank you in advance
Comments
Comment #1
sanguis commentedYou can do this by making that User Reference field a Relationship with in the view, then you add the rest of the user data as a field
Comment #2
karens commentedAnswered above.
Comment #4
gusantor commentedhello, thak you both for this info