/Drupal 8

function hook_config_schema_info_alter


Alter config typed data definitions.

For example you can alter the typed data types representing each configuration schema type to change default labels or form element renderers used for configuration translation.

If implementations of this hook add or remove configuration schema a ConfigSchemaAlterException will be thrown. Keep in mind that there are tools that may use the configuration schema for static analysis of configuration files, like the string extractor for the localization system. Such systems won't work with dynamically defined configuration schemas.

For adding new data types use configuration schema YAML files instead.


$definitions: Associative array of configuration type definitions keyed by schema type names. The elements are themselves array with information about the type.

See also



Related topics

Define functions that alter the behavior of Drupal core.


core/core.api.php, line 2217
Documentation landing page and topics, plus core library hooks.


function hook_config_schema_info_alter(&$definitions) {
  // Enhance the text and date type definitions with classes to generate proper
  // form elements in ConfigTranslationFormBase. Other translatable types will
  // appear as a one line textfield.
  $definitions['text']['form_element_class'] = '\Drupal\config_translation\FormElement\Textarea';
  $definitions['date_format']['form_element_class'] = '\Drupal\config_translation\FormElement\DateFormat';

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.