0
votes

I have a site built using drupal7. The site has a registration form now. There is a new requirement now for add a couple of new fields in the registration form and put it in a new page.

ie http://example.com/register is the existing drupal registration form and user submitting this form will be registered.

http://example.com/newpage is a new page with some content and registration form in it with two extra fields. When user submits this page a new user account will be created along with saving the new fields to the user profile.

Any ideas for implementing this in drupal is appreciated. Thanks

2

2 Answers

0
votes

Does it really have to be separated? Meaning that you need in both of your registration form (normal and a custom one). If not you can just add new fields to the "normal form" in the administration of your site, going to this path:

/admin/config/people/accounts/fields

In this interface you can add custom fields (like for content types) for user's profile. You can as well choose if the field appears during regitration.

0
votes

You can do this in about 15 minutes with basic understanding of the form API by creating a custom module.

What you need to look into:

  • Creating a module
  • Creating a menu hook (for your new custom page)
  • go to /admin/config/people/accounts/fields and create the new fields and add them to registration form
  • hook_form_alter - add logic in your module to check if arg(0) != your new page, and if so then hide the additional fields.

This should be enough to get you started. If this answer freaks you out then your probably in over your head. Pull up your socks or get some help.