Hello,

I'm using Drupal to create a fitness directory containing a list of fitness centers, personal trainers, fitness equipment... I have created a custom node type for each type of entry ("fitnesscenter", "personaltrainer", "fitnessequipment"...). Anyone can submit an entry in the directory, but they need to have a Drupal user account to do so.

Question : How do you replace the 2-step process of (1) registering a new user account into Drupal, and then (2) creating a new entry in the directory, by a single form where the new users can both register AND submit their entry at the same time?

Here's what the forms would look like:

FITNESS CENTER:
- username
- password
- name of fitness center
- address of fitness center
...

PERSONAL TRAINER:
- username
- password
- name of personal trainer
- rates of personal trainer
...

When the form is submitted and validated (username should not be already used, etc.), the system should 1) create a new user account, 2) create a new node with the entry details, 3) attach the new node to the new user account.

But I'm at a loss how to proceed here. At first, I thought I'd customise the user registration form, but it's impossible because 1) I need different customisations (one for fitness centers, one for personal trainers...); 2) I could no longer register standard users (i.e. users that are just users, and don't want to submit an entry in the directory).

Thank you,
Vincent

Comments

voidberg’s picture

Not sure it's what you want, but I created a lazy registration module for Drupal 4.7. It's pretty much done, but I haven't gotten to release it yet, it will probably happen next week.
If you think it helps, drop me a line and I'll send it to you.
--
Alexandru Badiu
alexAT417DOTro
http://www.voidberg.org

tyswan’s picture

I've been using Drupal for a while, but don't know much more than how to create nodes, and i hate tinkering under the bonnet. I try and use off-the-shelf modules without modifying them.

But from my perusal of Drupal, you could do what you want using webform & actions modules. But I think it would require quite a lot of work.

I'm thinking that:
1. You use webform to capture all the data necessary to both register a user, and create the entry in the directory.
2. Using the actions module, you trigger an action on submission of the webform which posts the appropriate data to the registration module, and the flexinode module by calling the appropriate add functions directly.

You'd want to wrap it in a transaction (don't know how you'd do that!), or live with the fact that sometimes the registration will work, but not necessarily the directory entry if there has been a glitch for some reason (can't think of anything specific, but transactions are good for this kind of thing).

Anyway, if this is no help to you, at least I've bumped you back to the top of the forum topics ;)

Cheers,
--
tys

vincentc’s picture

pixelmonk > Thanks for the offer. I sent you an e-mail.

tys > Thanks for the help. Unfortunately, that sounds very complicated. :) Besides, I've already developed my custom modules and nodes (with the underlying code and database tables), so I don't really need webform or flexinode.

In fact, the closest solution I found is the LoginToboggan module (http://drupal.org/project/logintoboggan): registration is still a 2-step process, but much smoother:

  • SCREEN 1 : new users enter their username, e-mail, and password
  • SCREEN 2 : new users are automatically logged in and redirected to the form where they can enter the remaining details