Drupal Advent Calendar day 3 - Contact Form

Door number 20
20
Door number 13
13
Door number 18
18
Door number 22
22
Door number 6
6
Door number 14
14
Door number 21
21
Door number 16
16
Door number 17
17
Door number 15
15
Door number 9
9
Door number 7
7
Door number 23
23
Door number 10
10
Door number 5
5
Door number 19
19
Door number 8
8
Door number 12
12
Door number 11
11
Door number 24
24
By james, 3 December, 2024
Day 3 revealing a speech bubble with a pencil filling in text

Today we’re looking at a fairly simple addition to Starshot, but one that can add a lot of power to a site.

While the default Drupal install provides a contact form, it does it through the rather basic “contact” module, that is built into Drupal Core. This has a lot of limitations, and many people prefer to use the more powerful “Webform” module.

Providing this in Drupal CMS saves the somewhat tedious process of adding a contact form to each Drupal installation. It also adds a Webform contact form in a more standard way, so sites are more likely to follow a consistent pattern when adding webforms.

Many sites will want to add custom fields to their contact form, but having a standard starting point is a big advantage.

This is how the default contact form looks:

Screenshot showing default Drupal CMS contact form.

Work is underway to add a mailing list sign up to this recipe. This will use the Drupal Simplenews module initially, though additional options, perhaps supporting external mailing list tools, may be added later. I’m not sure this will be bundled with the “Forms” recipe, or split off into a separate recipe.

This track is being led by J. Hogue (artinruins), and it’s great to see the progress that has been made with the contact form included as a default in the Drupal CMS installer.

Comments

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.