Webform 8.x-5.x Options: French departments

langcode: en
status: true
dependencies: {  }
id: french_departments
label: 'French departments'
options: |
  '01': Ain
  '02': Aisne
  '03': Allier
  '04': Alpes-de-Haute-Provence
  '05': Hautes-Alpes
  '06': Alpes-Maritimes
  '07': Ardèche
  '08': Ardennes
  '09': Ariège
  10: Aube
  11: Aude
  12: Aveyron
  13: Bouches-du-Rhône
  14: Calvados
  15: Cantal
  16: Charente
  17: Charente-Maritime
  18: Cher
  19: Corrèze
  2A: Corse-du-Sud
  2B: Haute-Corse
  21: Côte-dOr
  22: Côtes-dArmor
  23: Creuse
  24: Dordogne
  25: Doubs
  26: Drôme

Webform 8.x-5.x: How to track a webform submission's geolocation [VIDEO]

How to track a webform submission's geolocation

Problem

I would like to track where a form is being submitted from using the web browser's geolocation.

Solution

Create a hidden location element that tracks the user's geolocation as the default value.

Configurable behavior objects with @CfrPlugin

https://www.drupal.org/project/cfr
https://www.youtube.com/watch?time_continue=1&v=AejsIbZO2MI

The "Configurator plugin API (cfr)" is an API for "configuration-born behavior objects".
In site building it does take a similar, but more flexible and powerful role as the Drupal 8 plugin API or the CTools plugin API.

Webform 8.x-5.x: How to programmatically alter destination email address

You can alter the destination (to) address by adding a WebformHandler plugin. You can for example extend the EmailWebformHandler and add your own custom logic. This example changes the recipient based on the site's language:

The location of this file would be my_module/src/Plugin/WebformHandler/MyEmailWebformHandler.php

Webform 8.x-5.x: How to enable the Webform test modules

The Webform 8.x-5.x modules ships with several test modules that contain dozens of example forms that are used for automated testing and can also be used for debugging issues.

To enable the test modules, you can add$settings['extension_discovery_scan_tests'] = TRUE; to your settings.php file or you can enable the the default local.settings.php file that comes with Drupal 8.

Below is a screenshot of the available test forms.

Pages

Subscribe with RSS Subscribe to RSS - No known problems