0

I have made a new content type called wall and used user reference on it. Is there a way to auto create node whenever a new user is registered? I found the Autocreate Node Reference module but it doesn't have version 7 so I'm looking for an alternative.

2

This is a good example where Rules module can help you. I myself probably just write some custom code, since that's easy for me. But if you don't want to/can't do this, Rules can help you.

You can setup a rule, that is executed when a new user is created that will create a content of the chosen type. With tokens you can populate the values needed.

Using Rules can be a bit complex, but it's very powerful.

  • Ok I got rules to create node everytime a user is registered but I don't know how to make it enter a value in the reference field with rules – Ruriko Jan 19 '12 at 10:30
  • @Ruriko Like I said, You need to set the value to the field you created with tokens (the id of the user created) – googletorp Jan 19 '12 at 11:04
1

If you're going to write your own module. You can use hook_user_insert() to perform actions when a new user is added.

Then use node_save() to insert a new node

0

There is the Node Reference Create module for Drupal 7 (and 6) which does this. But probably you need to write a custom module to create a node after a user has registered.

  • I'm not a programmer so any other alternatives? – Ruriko Jan 19 '12 at 8:10
  • Does it not work with this module? – Lance Jan 19 '12 at 8:15
  • it doesn't have user reference but only node reference – Ruriko Jan 19 '12 at 8:46
  • Probably you try to describe again what you're trying to do. – Lance Jan 19 '12 at 8:55
0

In addition to what googletorp mentioned, do you think the link below would be of any help?

http://drupal.org/node/630814

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.