Drupal Advent Calendar day 3 - Contact Form

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.