This video covers possible locations for default configuration, what happens with configuration when a module is installed or uninstalled, managing dependencies in configuration, and where to find examples of default configuration.
- View Offline
(lighthearted music)…- [Voiceover] Now let's take a look at how to create…default configuration in a module.…When you create a module for Drupal,…It can be useful to provide default configuration.…This can be settings for a form,…or something more complex, like the default image styles…provided by the image module in core.…A module can provide a default configuration…for simple configuration or configuration entities.…In this tutorial, we'll cover…possible locations for default configuration,…what happens with configuration…when a module is installed or uninstalled,…managing dependencies in configuration,…and handling updates to configuration.…
For Drupal 8 modules, there are two places…that you can put default configuration:…In config/install, or config/optional.…Configuration placed in config/install…is only read once at install time.…This is a good place to put configuration…that should be active when a module is first installed.…If your module's configuration has dependencies…on other modules which may not be installed…
In this series of tutorials you'll learn all about the new configuration system in Drupal. Explore key concepts in configuration management and important skills, such as moving configuration from a local development environment to production and using the configuration system in a module. Find out how to use command-line tools such as Drupal Console, Drush, and Git, as well as GUI tools as an alternative for tasks like cloning a site and importing and exporting site configuration.
Developers can use the demo module provided with the exercise files, Transcode Profile, to explore default configuration, custom configuration entities, administrative forms, and working with configuration entity data in a form. By the end of the course, you'll understand how you can manage configuration between instances of your site and leverage the Drupal configuration system in a module.