Closed (won't fix)
Project:
Node Reference URL Widget
Version:
6.x-1.3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Sep 2009 at 15:18 UTC
Updated:
18 Dec 2011 at 04:08 UTC
Is it possible to extend this module to user reference? Or is there another module with this feature?
Comments
Comment #1
osopolarHave you considered to use the Content Profile Module to create user-profiles and set the node-reference to the users content-profile-node instead to the user himself?
Comment #2
osopolarIt would be nice to have a real user reference, because the content-profile-approach only works in cases where you can be sure that the content-profile already exists.
Comment #3
quicksketchThis won't be happening in this module (it's called "Node Reference URL Widget" for a reason).
Comment #4
nathaniel commentedSolution:
Place this code as the default for your user reference field then pass the uid as an argument in the url.
node/add/content-type/uid
Default value
PHP code
Comment #5
ocamp commentedwhere do I put this code?
Comment #6
finex commentedOn the "default value" field in the field settings page
Comment #7
NickWebman commentedTry using http://drupal.org/project/prepopulate to pre-populate the user reference field.
Install the References and Prepopulate module.
Note: Make sure to use a text field for the user reference field instead of a dropdown.
Let's use the example of associating musicians (users) with their songs (new content-type named "songs"). Pretend each musician has a user profile/is a user. On each musician's profile, let's add a link that lets us create a new song node. It will look something like...
http://yoursite.com/node/add/song?edit[field_user_reference][und][0][uid...
Now, if you follow that link, on the song creation page, the user reference field will be pre-populated with the user name "Buddy Holly". If you hide the user reference field with CSS (bad practice, I know), you'll be in business.
Note: this assumes you named your user reference field "user reference". If not, make sure the appropriate system name of the user reference field you created on the song content-type is reflected in the url example provided above.
As for making the last bit (the username / Buddy%20Holly) dynamic, I'm not sure. There's gotta be a way.
Works for D7. Not sure about D6.
Comment #8
sisko commentedI have the same problem of trying to link to a USER rather than a NODE.
Currently, I am using the CONTENT_PROFILE module which I can use with NODEREFERENCE_URL. But then I will have orphan content profiles because they will not actually be related to a user.
Is there a way to get a USER to be created along with a content profile using nodereference_url ??
Comment #9
mkadin commentedSince in D7 user's have content fields just like nodes do...it does seem like it makes sense as a feature. I'd be willing to help put it together for D7 if you're interested.