When using Search API Page, I needed to theme the search form in the bootstrap structure. The cleanest answer I have found is to add some variables to trigger the bootstrap overrides on the search form.
1 2 3 4 5 6 7 8 9 |
/** * Implements hook_form_FORM_ID_alter(). */ function MYMODULE_form_search_api_page_block_form_alter(&$form, FormStateInterface $form_state, $form_id) { // We need this to make our search_api_page_block_form rendered in the bootstrap fashion // This code was inspired by \Drupal\bootstrap\Plugin\Form\SearchBlockForm $form['actions']['submit']['#icon_only'] = true; $form['keys']['#input_group_button'] = true; } |
Additional Information
- Instructions made on Drupal 8.3.x (probably, haha).