DESCRIPTION:

This module provides a content entity that allows you to create configuration pages rich in customisable features. It allows to use any type of field defined by both the drupal core and contributed modules (files, images, paragraphs, media....).

This module is based on config_pages but with full integration with the "content_translation" module of the drupal core. This way you get a complete translation system for these custom configuration pages.

INSTALLATION:

Install this module like any other module.

CREATING CONFIG PAGE:

  1. After module installed, you can navigate to "/admin/structure/translatable_config_pages_types" and click on "Add translatable config pages type".
  2. Enter config page title, the description and the parent menu.
  3. Now you can find your config page y add desired fields as you do for any other entity.
  4. After configuring all the fields, you must enable the feature to translate the new configuration. You can do this from this URL: /admin/config/regional/content-language

HOW CAN I ACCESS MY SETTINGS?

You can get your custom config page data by the manager service.

// Load the default config.
$config = \Drupal::service('translatable_config_pages.manager')->loadConfig('my_bundle');

// Or load a translation config.
$language = \Drupal::languageManager()->getLanguage('es');
$config = \Drupal::service('translatable_config_pages.manager')->loadConfig('my_bundle', $language);

// Or load all languages config.
$languages = \Drupal::languageManager()->getLanguages();
$configs = [];
foreach ($languages as $language) {
  $languageId = $language->getId();
  $configs[$languageId] = \Drupal::service('translatable_config_pages.manager')->loadConfig($languageId);
}
Supporting organizations: 
Sponsored the module development

Project information

Releases