Drupal 8 now comes with the Contact module built in. This adds basic form functionality to the site to be used as personal or site-wide contact forms. However, in many cases, this is not enough. Luckily, there are options for you to choose from. With many of the features from Drupal 7 ported over, the Webform module for Drupal 8 is a feature-packed option that I prefer to employ. Here are 3 reasons why.
The Webform module uses Drupal’s Form API elements and stores them in Yaml configuration. Why is this great?
As a developer, there are two big reasons why I can appreciate Yaml. First, it is so easy to manipulate fields. All of the details of the field are nested on one page. Changing that information is simply locating the right line. Second, duplicating fields is as easy as Copy + Paste. The Yaml format is used to store every Webform. This means, you can duplicate elements of one form to another with a simple Copy + Paste.
However, that does not mean forms have to be built this way. You can also build forms with Drag + Drop by enabling the Webform UI module. In fact, with the GUI enabled, you are exposed to much more customization that the Form API does not offer. The UI and Yaml features within the Webform module makes building forms a much more pleasing experience.
Testing forms can be exasperating, especially when forms get bigger and more complex.
The Webform module comes with a testing feature built in. Simply click on the Test tab and Drupal will load your Webform with all of the fields filled in.
You can also preset the information that will be filled in. Go to
/admin/structure/webform/settings and open the Test Settings tab. This is where all of the test values are stored, in Yaml format of course.
A feature that I personally appreciate is the ability to make multi-step forms. The Webform module calls it Wizard Pages. This allows you to divide up your form into multiple steps or pages.
Not everyone will have to use this feature on their website. However, I found numerous use cases for these multi-step forms and the Webform module made the entire process effortless.
There are so many features of this module that have not even been mentioned here. You can find additional information on the module’s documentation page. Whether or not you use the features mentioned in this article, I hope everyone finds the Webform module's numerous features enjoyable!