Hi,

I work for a University and we are looking to move from Concrete5 to Drupal 8 in the new year! At this stage I'm trying a few things out to see how we would migrate across when the time is right. I'd like some advise please on the best-practise to do our "course application" form in Drupal 8. We have an application form for students to apply for courses. A couple of points on this:

  1. The form is broken into 3/4 pages. (e.g. first capture, about you, your experience, thank you page).
  2. Completed applications are communicated to our CRM (Sugar) via a cron job.

My own thoughts on it (as a newbie to Drupal):

  1. Create a custom "Applications" module.
  2. Use .install file to create the database table
  3. Use routes yml file to setup the URL endpoints (e.g. /apply/about-you, /apply/your-experience).
  4. Use buildForm() function and declare our form elements in there. (Would I have three separate controllers each with their own buildForm() and submitForm()?)
  5. I assume I can access an existing field in my custom form code? (E.g. our big list/select of "countries" will already exist).
  6. In terms of communicating the data to our Sugar CRM, we will have an enquiries form that also sends to Sugar so I assume the best practice would be to create a separate custom "Sugar" module?

Is there a more efficient and future-proofed way to setup our application form please? For example, should I be creating a new "content type" for this? I can't help but feel that our fields should be created in the CMS rather than in our controller/s?

Many thanks for any advice you can give me.

Nick

Comments

VM’s picture

I'd start by investigating the webform module @ https://www.drupal.org/project/webform which may cut out 1/2 of the work above. You will likely still require a module to communicate the data to your CRM.

https://www.drupal.org/project/ms_ajax_form_example is an example module for multi step forms if you decide to go the road of building your own module. However, I'm quite sure webform, provides the multistep option when building out a webform content type.