简体   繁体   English

Drupal 7中的多步骤注册表单,使用ajax作为视频步骤

[英]Multi step registration form in Drupal 7 with video as a step using ajax

I'm pretty new to Drupal but I've been developing in PHP for about 8 years now. 我对Drupal来说还很陌生,但是我从事PHP的开发已有8年了。 I've tried doing this using the admin UI modules but pretty much running up against a brick wall! 我已经尝试使用admin UI模块执行此操作,但是几乎可以撞墙了!

  1. I want to make a landing page ie example.com/username (Anonymous user gets this from supplied literature). 我想创建一个登陆页面,即example.com/username(匿名用户从提供的文献中获得此信息)。

  2. User fills out their details on step 1 用户在第1步上填写其详细信息

  3. User leaves feedback on step 2 用户在步骤2上留下反馈

  4. User watches a short video on step 3 before being able to click Next button 用户在可以单击“下一步”按钮之前观看了第3步的简短视频

  5. User fills out another field in step 4 and clicks finish 用户在步骤4中填写另一个字段,然后单击完成

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). 完成所有步骤后,我希望用户在Drupal网站上注册(这样,他们不必再次执行步骤1)。 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. 我知道我必须为此编写一个模块,但是在进入代码之前,请在这里询问是否有人知道可以使用Drupal 7。

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). 幸运的是,我刚在Drupal.org上看到了这篇文章 ,其中有人经历了将Drupal 7注册表单转换为多步骤表单的整个过程,因此这将是一个不错的起点(他们甚至发布了很多您需要的代码)。

The basic principle is to implement hook_form_user_register_form_alter in your module and convert the form into a multistep one. 基本原理是在模块中实现hook_form_user_register_form_alter并将表单转换为多步骤表单。 One of your steps would then be to show the video and implement the jQuery as you've mentioned in your comment. 然后,您的步骤之一就是显示视频并实现您在评论中提到的jQuery。 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. 我将不做任何更详细的说明,因为这只是在反省上面链接中的内容,而且还请查看Form API文档 ,这样做会有所帮助。

By the way if you're new to coding in Drupal grab the Examples module , it's a very valuable resource. 顺便说一下,如果您不熟悉Drupal编码,请抓住Examples模块 ,它是非常有价值的资源。

Hope that helps 希望能有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM