diff --git a/bootstrap_barrio.theme b/bootstrap_barrio.theme index 2e35a0be5a3c1f03eb93c94e3e77fe60f274a25b..5ca940bce1ab232972c0b47dba49388dd7ff2618 100644 --- a/bootstrap_barrio.theme +++ b/bootstrap_barrio.theme @@ -406,6 +406,15 @@ function bootstrap_barrio_theme_suggestions_form_alter(array &$suggestions, arra } } +/** + * Implements hook_theme_suggestions_HOOK_alter() for form templates. + */ +function bootstrap_barrio_theme_suggestions_input_alter(array &$suggestions, array $variables) { + if ($variables['element']['#type'] == 'submit' && theme_get_setting('bootstrap_barrio_button')) { + $suggestions[] = 'input__submit_button'; + } +} + /** * Implements hook_form_alter() to add classes to the search form. diff --git a/config/install/bootstrap_barrio.settings.yml b/config/install/bootstrap_barrio.settings.yml index 6cbe04b4a34db70317bcfb151af9dc07a4269372..06c05281b1cd716510baf3a9daee0cec0be7aa70 100644 --- a/config/install/bootstrap_barrio.settings.yml +++ b/config/install/bootstrap_barrio.settings.yml @@ -16,6 +16,7 @@ bootstrap_barrio_fluid_container: 0 # Buttons # -------------- +bootstrap_barrio_button: 1 bootstrap_barrio_button_size: '' bootstrap_barrio_button_outline: 0 diff --git a/subtheme/config/install/bootstrap_barrio_subtheme.settings.yml b/subtheme/config/install/bootstrap_barrio_subtheme.settings.yml index d4cf32c90ff4bff4d69a6ce0d2b572c27053552f..0d32c603ffe95af53e6892ec4af58f51ca9abbfe 100644 --- a/subtheme/config/install/bootstrap_barrio_subtheme.settings.yml +++ b/subtheme/config/install/bootstrap_barrio_subtheme.settings.yml @@ -16,6 +16,7 @@ bootstrap_barrio_fluid_container: 0 # Buttons # -------------- +bootstrap_barrio_button: 1 bootstrap_barrio_button_size: '' bootstrap_barrio_button_outline: 0 diff --git a/theme-settings.php b/theme-settings.php index 9c8d5a678963734614d33e18f57d4488aa4b5aaa..8a0222fb65dd78c2fd01cb45b472ed56108a5e90 100644 --- a/theme-settings.php +++ b/theme-settings.php @@ -179,6 +179,12 @@ function bootstrap_barrio_form_system_theme_settings_alter(&$form, FormStateInte '#collapsible' => TRUE, '#collapsed' => TRUE, ); + $form['components']['buttons']['bootstrap_barrio_button'] = array( + '#type' => 'checkbox', + '#title' => t('Convert input submit to button element'), + '#default_value' => theme_get_setting('bootstrap_barrio_button'), + '#description' => t('Convert all input submit to button element. There is a known issue with Ajax Exposed Filters, which do not work as the ajax commands expects an input element, no other issues have been detected at the time.'), + ); $form['components']['buttons']['bootstrap_barrio_button_size'] = array( '#type' => 'select', '#title' => t('Default button size'),