I'm working on a custom module in Drupal with a multi-page form approach, and I'd like to have a visualization of steps.
Step 1 > [_Step_2_] > Step 3 > Finish
Business Rules:
- they always see all the steps, and the step they are on now
- they can go back to any step they completed
- but they can't skip ahead to a step, say step 2 if they didn't finish step 1
Q1 : What's the best/ most Drupal-correct or Drupal-intuitive 开发者_Python百科way to implement this?
I looked around a little and found this :
Q2 : Is this a good option ? It looks like they are using the hook_menu system here ( MENU_LOCAL_TASK ) - how would I prevent the user from skipping ahead to steps?
Another way to do this is with variable functions. See
http://www.benjeavons.com/multi-step-forms-drupal-6-using-variable-functions (D6) http://growingventuresolutions.com/blog/drupal-7-multistep-forms-using-variable-functions (D7)
You can also use the form wizard in Chaos Tools which employs the same approach though I've never used that myself.
There is a module called webform
which I believe provides this functionality out of the box. You could use a webform
node to implement your multi step form, then handle the submission in your module.
精彩评论