I need a little help here. I am creating a sub theme of bootstrap theme and I need to add an additional fieldset under "Bootstrap Settings" form (similar to Components, Advanced etc which are currently present) which appears under Appearance->Settings-><THEME NAME>
page. I think we can use hook_form_alter()
for this but the problem is that hook_form_alter()
is being always invoked with $form_id
set to "search_form" and never "system_theme_settings". Thus any form updates I am making under this hook are getting applied to search box instead of admin settings form.
I referred code under bootstrap_form_alter()
in alter.inc
file in bootstrap theme and tried to replicate it in sub theme but it doesn't seem to work. In order to ensure that I am not making any mistakes while creating subtheme I also tried using other available subtheme such as one created by Adam Balsam (he has provided details on this in response to a question here.
Any help/pointers would be greatly appreciated.
I am listing below my code from template.php
file of the bootstrap_ignitor
sub theme
function bootstrap_ignitor_form_alter(&$form, &$form_state, $form_id) {
drupal_set_message('<pre>'.print_r($form_id,TRUE).'</pre>'); ***<= this always prints as search_block_form***
$form['actions']['submit']['#attributes']['class'][] = 'btn';
_bootstrap_ignitor_settings_form($form, $form_state);
}
function _bootstrap_ignitor_settings_form(&$form, $form_state) {
// Advanced settings.
$form['themealter'] = array(
'#type' => 'fieldset',
'#title' => t('Theme Alter'),
'#group' => 'bootstrap',
);
$form['themealter']['local_cdn'] = array(
'#type' => 'fieldset',
'#title' => t('NewBootstrapCDN'),
'#description' => t('Testing...'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
}