Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

custom_configuration

36 sites Security covered
View on drupal.org

Custom configuration management for a single site, Multi-domain & Multilingual.

This is a new module in Drupal 8/9/10. This module is more helpful where you want to save multiple configurations like Facebook, Twitter, Google Auth key and etc.

This module also works with multi-domain, multi-website and multilingual.

This module provides the following functionality:

1. Create an unlimited number of configurations.
2. Easy to use and understand.
3. Access saved configuration by machine name.
4. Set configuration as Active or Inactive, in case of inactive if you try to access the configuration it will return null.
5. Provides service to access configuration value by machine name.
6. If you are trying to access any non-exists machine name value, it will return null.

How to access configuration value by Machine name, Language code, and Domain key:

Syntax:
$value = \Drupal::service('custom.configuration')->getValue(machine_name,language_code,domain_key);
Parameters:
machine_name : required machine name.
language_code : Language code of the machine name that you want to get. If you will not pass
language_code it will get the value of the currently active language.
domain_key : Domain key of the machine name that you want to get. If you will not pass
domain_key it will get the value of the currently active domain.

Example :
Suppose there is a machine name mobile that wants to get value.

$value = \Drupal::service('custom.configuration')->getValue('mobile');
Sample output:
11111111111

How to access configuration value & optional value by Machine name, Language code and Domain key:

Syntax:
$value = \Drupal::service('custom.configuration')->getValues(machine_name,language_code,domain_key);
Parameters:
machine_name : required machine name.
language_code : Language code of the machine name that you want to get. If you will not pass
language_code it will get the value of the currently active language.
domain_key : Domain key of the machine name that you want to get. If you will not pass
domain_key it will get the value of the currently active domain.

Example :
Suppose there is a machine name mobile and want to get value & optional values.

$value = \Drupal::service('custom.configuration')->getValues('mobile');

Sample output :
stdClass Object
(
[machine_name] => mobile
[name] => Mobile Number
[value] => 11111111111
[langcode] => Array
(
[0] => en
)

[domain_key] => Array
(
[0] => default
)

[optional] => Array
(
[value_1] => Sales Team
[value_2] => Office Phone
[value_3] => Call at 9:00 AM - 6:00 PM
[value_4] => Saturday & Sunday Closed
)

)

How to access Configuration module:

Home -> Administration -> Configuration -> System -> Custom Configuration

Activity

Total releases
1
First release
Apr 2025
Latest release
1 year ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
11.0.0 Stable Apr 7, 2025