Is it possible to use Theme Settings API to add certain module settings to the theme settings?

Comments

JohnAlbin’s picture

Status: Active » Fixed

If a module wanted to have different settings for each theme, the correct place to put those settings would be the /admin/build/themes/settings/THEME form.

However, there's no reason to have a module dependency on the Theme Settings API module.

For example, if the captcha module were to have per-theme settings, you could use _form_alter() to add its settings. Take a look at the code in themesettingsapi.module.

function themesettingsapi_form_alter($form_id, &$form) {
  switch ($form_id) {
    case 'system_theme_settings':
      // [snipped code]

      // Move submit buttons to bottom
      $form['buttons']['#weight'] = 1;

      // [module settings here]
      break;
  }
}
Anonymous’s picture

Status: Fixed » Closed (fixed)