I support the Real Name module. In #324988: Support for Profile fields I have been asked to be able to use fields from from the Content Profile rather than the user profile. I have looked through the code and it is not immediately apparent to me how to access the fields. I think working this out will greatly benefit both modules (I see several issues in this queue that I could probably solve with Real Name.)
Comments
Comment #1
a_c_m commentedi think (and someone correct me if i'm wrong) its just a standard node with CCK fields, so you would need to get the CCK fields attached.
Comment #2
scottrigbyHI NancyDru...
The real name module is really helpful by the way (when using core profile fields) - it would be really great to see this work with content profile cck fields.
In my understanding - and limited experience with content profile -- the 'real name' is just one or more cck text fields.
I'll be happy to test as soon as there's something to work with ;)
Comment #3
nancydru@a_c_m: Okay, so how do I get those fields?
Comment #4
Christopher Herberte commentedNancyDru
Check out the CCK API in particular content_fields() first you'll need to establish the node type that you're dealing with.
Content Profile is simply a mechanism to flag nodes as profiles.
Hope this helps.
Comment #5
Christopher Herberte commented...
orand TokenComment #6
nancydruWell, I did a search and have read the handbook pages, but I wouldn't say I found an API anywhere. To begin this quest, I need to have the field names and types, not just the content. Token doesn't help if I don't know what fields to look for.
If you can point me to better docs, I would appreciate it.
Comment #7
Christopher Herberte commentedget a keyed array of all the node types which are content profiles (requires content_profile.module)
retrieve the field info for 'profile' node type (requires cck)
or
-- neither are documented as such but you can check the module's source for more info, i hope this helps.
Comment #8
nancydruThank you. That looks promising.
Comment #9
nancydruI'm very close to a complete solution. Thank you, Chris Herberte, for the code.
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #11
mikedotexe commentedMan, it seems like this is what you want. It certainly was what I wanted.
Drupal - Content Profile Node from UID
$profile_node = content_profile_load('profile', $uid);Then you can dsm it (if you have Devel installed, to see all the fields you want to look at.
dsm($profile_node)and grab it from there.API call for Drupal 6:
http://drupalcontrib.org/api/drupal/contributions--content_profile--cont...