views:

64

answers:

2

Is there an easy way to allow a user to register as he creates content type. E.g. Let's say there is a content type called "listing". When the user clicks to on a link to create it, and he's not logged in, I want a "register" box to appear ABOVE THE CONTENT CREATION area, where the user can enter his normal registration details. Is this possible?

+2  A: 

You should be able to do this with hook_form_alter. So you can run a check if the node is being created (no nid set yet) and the user is no logged in, and then just add a fieldset with the info needed to create an account. You need to add a validation and submit handler as well to check the data and create the actual user.

All you need to do then, is to pair the node to the new user, but that should be possible in the submit handler where you create the user.

googletorp
Guess that means there is no module with this functionality.
RD
@RD It's something that would be easier to create, than it would be to check in to CVS. Also making this generic would create a lot of extra work, so doubt there is a module for this.
googletorp
+2  A: 

While you could, technically, put something like that together on your own, http://drupal.org/project/inline_registration is a reasonable match. It only has a dev snapshot release, but I've used it on some very small test sites and it didn't destroy anything.

Eaton