You are here

function opigno_search_form_alter in Opigno Search 8

Same name and namespace in other branches
  1. 3.x opigno_search.module \opigno_search_form_alter()

Implements hook_form_alter().

File

./opigno_search.module, line 51
Contains opigno_search.module.

Code

function opigno_search_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  switch ($form['#id']) {
    case 'views-exposed-form-search-content-page-1':
      unset($form['#info']['filter-search_api_fulltext']['label']);
      $form['keys']['#type'] = 'search';
      $form['keys']['#title'] = t('Search');
      $form['keys']['#title_display'] = 'invisible';
      $form['#attached']['library'][] = 'opigno_search/search_form';
      $form['#method'] = 'get';
      break;
  }
}