In this video, we cover how to load configuration entities using EntityTypeManager via the services container; update the AdminSettingsForm.php to use a dropdown select list; save your preferred transcode profile from a list of transcode profile entities; and update the default configuration provided with the demo module to include transcode profiles.
- View Offline
(serene music)…- [Instructor] In this tutorial we'll load…configuration entity data in a module…and utilize that data in a form.…We'll refactor adminsettingsform.php…and replace the text field with a drop…down select list.…To populate the options we'll use data…from our transcode profile configuration entity.…By the end of this tutorial you should be…able to know how to load configuration entities…using EntityTypeManager via the services container,…update the adminsettingsform.php to use…a drop down select list, save your preferred…transcode profile from a list of transcode…profile entities, update the default configuration,…provided with a demo module to include transcode profiles.…
What we're going to do is change this text field…to a select drop down element and load up…the option elements with data from…our configuration entity, so let's get started.…First we'll open up admin settings form…which is located in our custom module…in source form and at the top we need…to add some use statements.…So we have two here already and we're going…
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.