Multi step registration form in Drupal 7 with vide

2019-08-01 18:19发布

问题:

I'm pretty new to Drupal but I've been developing in PHP for about 8 years now. I've tried doing this using the admin UI modules but pretty much running up against a brick wall!

  1. I want to make a landing page ie example.com/username (Anonymous user gets this from supplied literature).

  2. User fills out their details on step 1

  3. User leaves feedback on step 2

  4. User watches a short video on step 3 before being able to click Next button

  5. User fills out another field in step 4 and clicks finish

When this is all done, I want the user to be then registered with the Drupal site (so they don't have to do step 1 again). I know I would have to write a module for this but asking here to see if anyone knows it's possible to do with Drupal 7 before I get into the code.

Thanks in advance! :)

回答1:

By a stroke of luck I just came across this post on Drupal.org in which someone has gone through the whole process of converting the Drupal 7 registration form into a multistep one, so this would be a great place to start (they've even posted a lot of the code you'll need).

The basic principle is to implement hook_form_user_register_form_alter in your module and convert the form into a multistep one. One of your steps would then be to show the video and implement the jQuery as you've mentioned in your comment. I won't go into any more detail as it would just be regurgitating what's in the link above, but also check out the Form API documentation, it'll help when doing this.

By the way if you're new to coding in Drupal grab the Examples module, it's a very valuable resource.

Hope that helps



标签: ajax drupal