logo
Submitted by Mikhail Ismajlov on Wed, 10/16/2019 - 07:41

At the core of Drupal 8 is a great Contact module. The Contact module almost reaches the Webform module. So let's see how to make a feedback form for our site.

If Contact is not enabled, enable it.

Contact already has a feedback form. It is located at:

/contact

contact form

Let's change this form to look more like a feedback form. To do this, go to the page for setting contact forms Structure -> Contact forms

/admin/structure/contact

contact form

Let's go to the website feedback edit. I think it’s worth changing the names, writing down your email addresses and an automatic reply to the sender of the message.

edit contact form

 

Now let's rename the Email field and add the phone field. Fields Name and Email are filled out from the data of registered users automatically. If the user is anonymous, then the fields for filling in the Name and Email are displayed for him. To do this, let's go into Manage fields:

contact form

On this page you can rename, add new fields. Let's add the Phone field, with the phone field type. But for this we need to first enable the Telephone module:

telephone

Now we can add a new phone field.

phone

Now let's go to the Manage display tab and reorder the fields. I think it's tedious to remove the Subject fields and Send copy to sender (you can leave them if you think necessary). I also added a placeholder in the Phone field settings, this is the placeholder of the field, which disappears when you click on the field. This allows you to show in what form you need to fill out the field.

Drupal Contact Form

We can now send messages from the contact page:

Друпал контактная форма