How to declare custom variables in your own module to show on admin/config/system/variable/realm/domain/configure?

Last updated on
30 April 2025

From http://drupal.org/node/1809794#comment-6588382

Add

'multidomain' => TRUE

when defining your variables, & clear your caches for the variables to get picked up.

You should end up with the code similar to this:

function MODULENAME_variable_info($options) {
  $variables['variable_name_1'] = array(
    'type' => 'text',
    'title' => t('Variable 1', array(), $options),
    'default' => '',
    'multidomain' => TRUE,
    'description' => t('What variable 1 does.', array(), $options),
  );
  $variables['variable_name_2'] = array(
    'type' => 'text',
    'title' => t('Variable 2', array(), $options),
    'default' => '',
    'multidomain' => TRUE,
    'description' => t('What variable 2 does.', array(), $options),
  );
  return $variables;
}

Help improve this page

Page status: Not set

You can: