Drupal 7中的多步骤注册表格,视频为ajax的步骤 [英] Multi step registration form in Drupal 7 with video as a step using ajax

查看:113
本文介绍了Drupal 7中的多步骤注册表格,视频为ajax的步骤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Drupal很新,但是现在PHP已经开发了大约8年了。我试过这样做使用管理UI模块,但几乎跑到砖墙!


  1. 我想做一个着陆页,例如example.com/username(匿名用户从提供的文献中获取此信息)。


  2. 用户填写他们在步骤1上的详细信息

    / li>
  3. 用户留下关于步骤2的反馈


  4. 用户在步骤3之前观看短视频,然后才能点击下一个按钮


  5. 用户在步骤4中填写另一个字段,并点击完成


当这一切都完成后,我想让用户在Drupal站点注册(所以他们不必再做第1步)。我知道我必须为此编写一个模块,但要问这里是否有人知道在进入代码之前是否有可能使用Drupal 7。



谢谢提前! :)

解决方案

运气一下,我刚刚遇到 Drupal.org上的这篇文章,其中有人通过将Drupal 7注册表单转换为多步骤的全过程,因此这将是一个很好的开始(他们甚至发布了很多您需要的代码。)



基本原则是实现 hook_form_user_register_form_alter 在您的模块中,并将表单转换为多步骤。您的步骤之一就是显示视频并实现jQuery,就像您在评论中提到的那样。我不会再详细介绍,因为它只是反思上面链接的内容,还可以查看 Form API文档,这样做会有所帮助。



顺便说一句,在Drupal中进行编码的新手抓住了示例模块,这是一个非常有价值的资源。



希望有助于


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! :)

解决方案

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

这篇关于Drupal 7中的多步骤注册表格,视频为ajax的步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆